﻿<!-- #Include File="Channel_Config.asp" -->
<!-- #Include File="../Include/Admin_Onlogin.asp" -->
<!-- #Include File="../../Include/UpRemote.asp" -->
<%
Data_Name = "{prefix}"&ChannelDataName
strFileName = "Admin_" & ChannelDir & ".asp"
Dim sqlAuth, rsAuth, PurviewID
sqlAuth = "Select AuthID From Admin_Auth Where href='" & ChannelDir & "/" & strFileName & "?ChannelID="&ChannelID&"' Order By sort Asc,AuthID Asc"
Call Exec(rsAuth,sqlAuth,2)
If rsAuth.BOF And rsAuth.EOF Then
	PurviewID = 0
Else
	PurviewID = rsAuth(0)
	CheckPurview PurviewID,0
End If
rsAuth.Close
Set rsAuth = Nothing
Select Case Action
Case "Add"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Add' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call Add()
Case "SaveAdd"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Insert' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call SaveAdd()
Case "Modify"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Edit' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call Modify()
Case "SaveModify"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Update' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call SaveModify()
Case "SetePassed", "CancelPassed"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Passed' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call SetProperty()
Case "Del"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Del' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call Del()
Case "ConfirmDel"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Del' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call ConfirmDel()
Case "ClearRecycleBin"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Recycle' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call ClearRecycleBin()
Case "DelFile"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Del' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call DelFile()
Case "BatchReplace"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Replace' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call BatchReplace()
Case "DoBatchReplace"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/DoReplace' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call DoBatchReplace()
Case "CheckTitle"
	Call CheckTitle()
Case "GetKeyWords"
	Call GetKeyWords()
Case "Restore"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Restore' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call Restore()
Case "RestoreAll"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Restore' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call RestoreAll()
Case "ListOrder"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Order' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call ListOrder()
Case "ReOrder"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Order' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call ReOrder()
Case "Tree"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Move' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,0
	Else
		CheckPurview rsAuth(0),0
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call Tree()
Case "Move"
	sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Move' Order By sort Asc,AuthID Asc"
	Call Exec(rsAuth,sqlAuth,2)
	If rsAuth.BOF And rsAuth.EOF Then
		CheckPurview 0,1
	Else
		CheckPurview rsAuth(0),1
	End If
	rsAuth.Close
	Set rsAuth = Nothing
	Call Move()
Case "LeftList"
	Call LeftList()
Case "Listing"
	Call Listing()
Case Else
	Call Main()
End Select
If FoundErr=True Then
	Call WriteErrMsg(ErrMsg, ComeUrl)
End If
Call CloseConn()

Sub Modify()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<link href='../Plugins/bootstrap-tagsinput/bootstrap-tagsinput.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script src='../Plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js' type='text/javascript'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='"&InstallDir&"UEditor/ueditor.config.js'></script>" & vbCrlf
	Response.Write "<script type='text/javascript' src='"&InstallDir&"UEditor/ueditor.all.js'></script>" & vbCrlf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/xm-select/xm-select.js""></script>" & vbCrLf
	Response.Write "</head>" & vbCrlf
	Response.Write "<body>" & vbCrlf
	Dim id, oIncludeInfo, Title, Tcolor, Subtitle, Subheading, Csid, Keyes, Author, Inputer, CopyFrom, Tim, Hidden, Hits, UseLinkUrl, LinkUrl, Intro, Content, SEOTitle, SEOKeyWord, SEODescript, Moban, SkinID, TemplateID, PaginationType, MaxCharPerPage, PageTitle, Pic, IsPic, UploadFiles, UpdateClasses, StrDownloadUrl, uppic, SqlFieldSet, RsFieldSet, i, Pv_Field, Pv_FieldName, Pv_FieldValue, Pv_FieldType, Pv_FieldOptions, Pv_FieldTips, ErrorMsg, LayVerify, AttrNotNull, OptionTool, Pv_Array, Pv_Array2, Fn_Field
	id=Code_ID("id")
	sql="Select top 1 * From "&Data_Name&" Where id="&id
	Call Exe_Conn(rs,sql,3)
	If rs.eof Then
		rs.close
		Response.Write IsSuccess(ChannelTit&"ID（"&id&"）不存在！","Admin/" & ChannelDir & "/" & strFileName & "?Action=Listing&ChannelID=" & ChannelID & "")
		Exit Sub
	End If
	StrDownloadUrl=Trim(Trim(rs("UploadFiles")))
	If Instr(StrDownloadUrl,"@@@") >0 Then
		StrDownloadUrl=Split(StrDownloadUrl,"@@@")
		For i=0 to Ubound(StrDownloadUrl)
			If i=0 Then
				uppic=uppic&StrDownloadUrl(i)
			Else
				uppic=uppic&"|"&StrDownloadUrl(i)
			End If
		Next
	Else
		uppic=uppic&StrDownloadUrl
	End If
	Response.Write "<form class='layui-form layui-form-pane' name='myform' action='?Action=SaveModify&ChannelID=" & ChannelID & "&id=" & id & "' method='post'>" & vbCrlf
	Response.Write "<input type='hidden' id='upid' name='upid' value=''>" & vbCrlf
	Response.Write "<input type='hidden' id='uppic' name='uppic' value='" & uppic & "' onchange=""doChange('uppic','TempUploadFiles','Pic','" & Lcase(InstallDir & UploadSetting(1)) & "','" & Lcase(UploadSetting(1)) & "','" & Lcase(InstallDir) & "','" & Lcase(InstallDir & UploadSetting(1) & "/" & ChannelDir) & "','/" & ChannelDir & "')"">" & vbCrlf
	Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrlf
	Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
	Response.Write "        <legend>编辑" & ChannelTit & "</legend>" & vbCrlf
	Response.Write "    </fieldset>" & vbCrlf
	Response.Write "    <div class=""layui-tab"">" & vbCrlf
	Response.Write "        <ul class=""layui-tab-title"">" & vbCrlf
	Response.Write "            <li class=""layui-this"">基本信息</li>" & vbCrlf
	Response.Write "            <li>SEO管理</li>" & vbCrlf
	Response.Write "            <li id=""MobanTag"">模板设置</li>" & vbCrlf
	Response.Write "        </ul>" & vbCrlf
	Response.Write "        <div class=""layui-tab-content"">" & vbCrlf
	Response.Write TopicShowColor(rs("IncludeInfo"),"Title",rs("Title"),"Tcolor",rs("Tcolor"),"Subtitle",rs("Subtitle"),"Subheading",rs("Subheading"),id)
	Response.Write Class_InitSelect(ChannelID,rs("ClassID"))
	SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle<>1 ORDER BY OrderNum ASC"
	Call Exec(RsFieldSet,SqlFieldSet,2)
	i = 0
	Do While Not(RsFieldSet.Eof)
		Pv_Field = RsFieldSet("Field")
		Pv_FieldName = RsFieldSet("FieldName")
		Pv_FieldValue = RsFieldSet("FieldValue")
		Pv_FieldType = RsFieldSet("FieldType")
		Pv_FieldOptions = RsFieldSet("FieldOptions")
		Pv_FieldTips = RsFieldSet("FieldTips")
		
		SqlField = "Select "& Pv_Field &" From "&Data_Name&" Where ID="&ID
		Call Exec(RsField,SqlField,2)
		If Not(RsField.Eof) Then Pv_FieldValue = RsField(0)
		
		If Code_CLng(RsFieldSet("NotNull"))>0 Then
			If RsFieldSet("ErrorMsg")<>"" Then
				ErrorMsg = RsFieldSet("ErrorMsg")
			Else
				ErrorMsg = Pv_FieldName & "不能为空或填写不正确！"
			End If
			If RsFieldSet("Pattern")="required" Then
				LayVerify = " lay-verify="""&Pv_Field&""""
			Else
				LayVerify = " lay-verify="""&Pv_Field&"|"& RsFieldSet("Pattern") &""""
			End If
			If Pv_FieldType="editor" Then
				If i = 0 Then
					AttrNotNull = AttrNotNull & "1|"&Pv_Field&"|"&ErrorMsg&""
				Else
					AttrNotNull = AttrNotNull & ",1|"&Pv_Field&"|"&ErrorMsg&""
				End If
			ElseIf Pv_FieldType="radio" Then
				If i = 0 Then
					AttrNotNull = AttrNotNull & "2|"&Pv_Field&"|"&ErrorMsg&""
				Else
					AttrNotNull = AttrNotNull & ",2|"&Pv_Field&"|"&ErrorMsg&""
				End If
			ElseIf Pv_FieldType="checkbox" Then
				'If i = 0 Then
					'AttrNotNull = AttrNotNull & "3|"&Pv_Field&"|"&ErrorMsg&""
				'Else
					'AttrNotNull = AttrNotNull & ",3|"&Pv_Field&"|"&ErrorMsg&""
				'End If
			Else
				If i = 0 Then
					AttrNotNull = AttrNotNull & "0|"&Pv_Field&"|"&ErrorMsg&""
				Else
					AttrNotNull = AttrNotNull & ",0|"&Pv_Field&"|"&ErrorMsg&""
				End If
			End If
			i = i + 1
		End If
		
		Select Case Pv_FieldType
		Case "text"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""" class=""layui-input"""& LayVerify &">&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "textarea"
			Response.Write "                <div class=""layui-form-item layui-form-text"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-block"">" & vbCrlf
			Response.Write "                        <textarea type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" rows=""4"" cols=""80"" maxlength=""255"""& LayVerify &" class=""layui-textarea"">"& Pv_FieldValue &"</textarea>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "editor"
			If RsFieldSet("OptionMode")=2 Then
				OptionTool=OptionTool&"'Source','Undo', 'Redo','|','Bold','Italic','Underline','ForeColor','BackColor','|','FontFamily', 'FontSize','|','JustifyLeft','JustifyCenter','JustifyRight','JustifyJustify','|','Simpleupload','Insertimage','Link','Unlink','AutoTypeSet','FullScreen'"
			ElseIf RsFieldSet("OptionMode")=3 Then
				OptionTool=OptionTool&"'Source', '|', "&RsFieldSet("OptionTool")&",'|','Fullscreen'"
			Else
				OptionTool=OptionTool&"'Fullscreen', 'Source', '|', 'Undo', 'Redo', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Bold', 'Italic', 'Underline', 'Fontborder', 'Strikethrough', 'Superscript', 'Subscript', 'Removeformat', 'Formatmatch', 'Autotypeset', 'Blockquote', 'Pasteplain', '|', 'Forecolor', 'Backcolor', 'Insertorderedlist', 'Insertunorderedlist', 'Selectall', 'Cleardoc', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Rowspacingtop', 'Rowspacingbottom', 'Lineheight', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Customstyle', 'Paragraph', 'Fontfamily', 'Fontsize', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Directionalityltr', 'Directionalityrtl', 'Indent', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Justifyleft', 'Justifycenter', 'Justifyright', 'Justifyjustify', '|', 'Touppercase', 'Tolowercase', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Link', 'Unlink', 'Anchor', '|', 'Imagenone', 'Imageleft', 'Imageright', 'Imagecenter', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Simpleupload', 'Insertimage', 'Emotion', 'Scrawl', 'Insertvideo', 'Music', 'Attachment', 'Map', 'Insertframe', 'Insertcode', 'Pagebreak', 'Template', 'Background', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Horizontal', 'Date', 'Time', 'Spechars', 'Wordimage', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Inserttable', 'Deletetable', 'Insertparagraphbeforetable', 'Insertrow', 'Deleterow', 'Insertcol', 'Deletecol', 'Mergecells', 'Mergeright', 'Mergedown', 'Splittocells', 'Splittorows', 'Splittocols', 'Charts', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Print', 'Preview', 'Searchreplace', 'Help'"
			End If
			Response.Write "                <div class=""layui-form-item layui-form-text"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-block"">" & vbCrlf
			Response.Write "                        <textarea id='"&Pv_Field&"' name='"&Pv_Field&"'"& LayVerify &">"&Pv_FieldValue&"</textarea>"
			Response.Write "                        <script type=""text/javascript"">"
			Response.Write "                        var editor = UE.getEditor('"&Pv_Field&"',{serverUrl:'"&InstallDir&AdminFolder&"/Include/Upload.asp?channelid=" & ChannelID & "&classid=" & ClassID & "',toolbars:[["&OptionTool&"]],initialFrameWidth:'100%',initialFrameHeight:'160'});"
			Response.Write "                        </script>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "radio"
			Pv_Array = Split(Pv_FieldOptions,",")
			Fn_Temp = ""
			For Pv_ii=0 To Ubound(Pv_Array)
				Fn_Temp = Fn_Temp &"<input type=""radio"" name="""& Pv_Field &""" "& Check_Object(Pv_FieldValue,Split(Pv_Array(Pv_ii),"|")(0)," checked") &" value="""& Split(Pv_Array(Pv_ii),"|")(0) &""" title="""&Split(Pv_Array(Pv_ii),"|")(1)&""" lay-verify="""&Pv_Field&""">"
			Next
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        "& Fn_Temp &"&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "checkbox"
			Pv_Array = Split(Pv_FieldOptions,",")
			If Pv_FieldValue<>"" Then
				Pv_Array2 = Split(Pv_FieldValue,", ")
			End If
			Fn_Temp = ""
			For Pv_ii=0 To Ubound(Pv_Array)
				Fn_Temp2 = ""
				If Pv_FieldValue<>"" Then
					For Pv_jj=0 To Ubound(Pv_Array2)
						If Pv_Array2(Pv_jj)=Split(Pv_Array(Pv_ii),"|")(0) Then
							Fn_Temp2 = " checked=""checked="""
						End If
					Next
				End If
				Fn_Temp = Fn_Temp &"<input type=""checkbox"" lay-filter="""& Pv_Field &""""& Fn_Temp2 &" value="""& Split(Pv_Array(Pv_ii),"|")(0) &""" title="""&Split(Pv_Array(Pv_ii),"|")(1)&""">"
			Next
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""hidden"" name="""& Pv_Field &""" value="""& Pv_FieldValue &""""& LayVerify &">"& Fn_Temp &"&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "select"
			Pv_Array = Split(Pv_FieldOptions,",")
			Fn_Temp = ""
			For Pv_ii=0 To Ubound(Pv_Array)
				Fn_Temp = Fn_Temp &"_data.push(['"& Split(Pv_Array(Pv_ii),"|")(0) &"','"& Split(Pv_Array(Pv_ii),"|")(1) &"']);"
			Next
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <div id="""& Pv_Field &"_outer"" ztype=""select"" class=""z-combox"" style=""display:inline-block; *zoom: 1;*display: inline;vertical-align:middle;height:auto;width:auto;position:relative;border:none 0;margin:0;padding:0;white-space: nowrap;"" _style=""width:150px;""><input type=""text"" ztype=""select"" id="""& Pv_Field &""" name="""& Pv_Field &""" tabindex=""-1"" autocomplete=""off"" class=""inputText"" style=""width:150px;position:absolute;z-index:-1;"" value=""" & Pv_FieldValue & """ startvalue=""" & Pv_FieldValue & """"& LayVerify &"/><input type=""text"" id="""& Pv_Field &"_textField"" autocomplete=""off"" class=""inputText"" style=""vertical-align:middle; cursor:default;width:150px;"" /><a id="""& Pv_Field &"_spinner"" class=""z-combox-spinner"" style=""position:relative; left:-17px; margin-right:-15px; cursor:pointer; width:13px; height:15px;vertical-align:middle;""><b></b></a><div id="""& Pv_Field &"_list"" class=""optgroup"" style=""text-align:left;display:none;""><div id="""& Pv_Field &"_ul"" style=""left:-1px; width:-1px;""><script>Combox_"& Pv_Field &"_Init=function(){var _el=Zving.getDom('"& Pv_Field &"');if(_el._components){return true;}var  _data=[];var  _DataSource;_data.push(['','请选择...']);"& Fn_Temp &"var combox_"& Pv_Field &" = new Zving.Selector({el:_el,data:_data,DataSource:_DataSource});};if(Zving.Page.isReady){Combox_"& Pv_Field &"_Init();}else{Zving.Page.onReady(Combox_"& Pv_Field &"_Init);}</script></div></div></div>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "number"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" class=""TxtClass slong"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""" onblur=""this.value=this.value.replace(/[^0-9.]*/g,'');"""& LayVerify &" />&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "datetime"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""""& LayVerify &" />&nbsp;<button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""SelectTime('"& Pv_Field &"','yyyy-MM-dd HH:mm:ss','','');"">选择</button>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                        <script>" & vbCrlf
			Response.Write "                        layui.use(""laydate"", function () {" & vbCrlf
			Response.Write "                            var laydate = layui.laydate;" & vbCrlf
			Response.Write "                            laydate.render({" & vbCrlf
			Response.Write "                                elem: ""#"& Pv_Field &"""," & vbCrlf
			Response.Write "                                type:""datetime""," & vbCrlf
			Response.Write "                                format:""yyyy-MM-dd HH:mm:ss""" & vbCrlf
			Response.Write "                            });" & vbCrlf
			Response.Write "                        })" & vbCrlf
			Response.Write "                        </script>" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "image"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""""& LayVerify &" />" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""SelectFile('"&ChannelID&"','"&ChannelModuleType&"','1','1','"&Pv_Field&"','','','','0','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">浏览</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""UploadFile('"&ChannelID&"','"&ChannelModuleType&"','1','0','"&ClassID&"','1','0','0','"&Pv_Field&"','','','','','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">上传</button>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "zutu"
			Response.Write Info_ZuTu(ChannelID,Pv_Field,Pv_FieldName,Pv_Field&"ImageArea",Pv_FieldValue,"Pic","TempUploadFiles",LayVerify,Pv_FieldTips)
		Case "file"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""""& LayVerify &" />" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""SelectFile('"&ChannelID&"','"&ChannelModuleType&"','3','1','"&Pv_Field&"','','','','0','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">浏览</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""UploadFile('"&ChannelID&"','"&ChannelModuleType&"','2','0','"&ClassID&"','1','0','0','"&Pv_Field&"','','','','','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">上传</button>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case Else
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""" class=""layui-input"""& LayVerify &">&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		End Select
		RsFieldSet.MoveNext
	Loop
	Response.Write KeyWord_Init(ChannelID,rs("Keyes"))
	Response.Write Info_Derivation(rs("Author"),rs("Inputer"),rs("CopyFrom"),rs("Tim"),"","",ChannelID)
	Response.Write Info_Init(RemoteTrue,FristTrue,rs("Hidden"),rs("Hits"))
	Response.Write Html_LinkUrl(rs("LinkUrl"))
	Response.Write Html_Edit(rs("LinkUrl"),"Intro","简介",rs("Intro"),"Content","内容",Code_Word(rs("Content")),"100%",350)
	Response.Write Html_Page(rs("LinkUrl"),rs("PaginationType"),rs("MaxCharPerPage"),rs("PageTitle"))
	Response.Write Info_FrmUpload(ChannelID,rs("Pic"),"Pic",0,"首页图片","图片",0,0,"TempUploadFiles")
	Response.Write Info_UploadList("Pic","图片","",rs("UploadFiles"),"TempUploadFiles")
	Response.Write Info_ZuTu(ChannelID,"Zutu","组图","ImageArea",rs("Zutu"),"Pic","TempUploadFiles","","")
	Response.Write Html_SEO(rs("SEOTitle"),rs("SEOKeyWord"),rs("SEODescript"))
	Response.Write Html_Moban(rs("LinkUrl"),rs("Moban"),rs("SkinID"),rs("TemplateID"),ChannelID)
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "</div>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<input name=""ID"" type=""hidden"" id=""ID"" value=""" & ID & """>" & Submit_Layui("提交修改","重新填写","确认要清空对话框内容？","javascript:history.back();","返回上一页"," onclick=""PostUrl('myform','TempUploadFiles','UploadFiles');""") & vbCrlf
	Response.Write "</form>" & vbCrlf
	Response.Write "<script>" & vbCrlf
	Response.Write "layui.use(['form','element'], function () {" & vbCrlf
	Response.Write "    var form = layui.form,element = layui.element;" & vbCrlf
	Response.Write "    //自定义表单验证" & vbCrlf
	Response.Write "    form.verify({" & vbCrlf
	Response.Write "        Title: function (value, item) {" & vbCrlf
	Response.Write "            if (!value){" & vbCrlf
	Response.Write "                item.focus();" & vbCrlf
	Response.Write "                return """ & ChannelTit & "标题不能为空！"";" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "        ClassID: function (value, item) {" & vbCrlf
	Response.Write "            if (!value || value == '0'){" & vbCrlf
	Response.Write "                item.focus();" & vbCrlf
	Response.Write "                return ""请选择" & ChannelTit & "栏目！"";" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "        Content: function (value, item) {" & vbCrlf
	Response.Write "            if($(""input:checkbox[name='UseLinkUrl']:checked"").val()!=""Yes""){" & vbCrlf
	Response.Write "                if (!UE.getEditor('Content').getContent()){" & vbCrlf
	Response.Write "                    UE.getEditor('Content').focus();" & vbCrlf
	Response.Write "                    return """ & ChannelTit & "内容不能为空！"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "        LinkUrl: function (value, item) {" & vbCrlf
	Response.Write "            if($(""input:checkbox[name='UseLinkUrl']:checked"").val()==""Yes""){" & vbCrlf
	Response.Write "                if (!value){" & vbCrlf
	Response.Write "                    item.focus();" & vbCrlf
	Response.Write "                    return ""链接地址不能为空！"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "                if (value.indexOf('://') == -1 && value.substr(0, 1) != '/'){" & vbCrlf
	Response.Write "                    item.select();" & vbCrlf
	Response.Write "                    return ""本站地址请以 \/ 开头。"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "                if (value.indexOf('://') != -1 && !(/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/.test(value))){" & vbCrlf
	Response.Write "                    item.select();" & vbCrlf
	Response.Write "                    return ""链接格式不正确！"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
	Call Exec(RsFieldSet,SqlFieldSet,2)
	Do While Not(RsFieldSet.Eof)
		If Code_CLng(RsFieldSet("NotNull"))>0 Then
			If RsFieldSet("FieldType")="radio" Then
				Pv_FieldArray = Split(RsFieldSet("FieldOptions"),",")
				Fn_Field = ""
				For Pv_ii=0 To Ubound(Pv_FieldArray)
					If Pv_ii=0 Then
						Fn_Field = Fn_Field &"val == """& Split(Pv_FieldArray(Pv_ii),"|")(0) &""""
					Else
						Fn_Field = Fn_Field &" || val == """& Split(Pv_FieldArray(Pv_ii),"|")(0) &""""
					End If
				Next
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = RsFieldSet("ErrorMsg")
				Else
					ErrorMsg = RsFieldSet("FieldName") & "不能为空或填写不正确！"
				End If
				Response.Write "        "&RsFieldSet("Field")&": function (value, item) {" & vbCrlf
				Response.Write "            var val = $(""input:radio[name='"&RsFieldSet("Field")&"']:checked"").val();" & vbCrlf
				Response.Write "            if (!("&Fn_Field&")){" & vbCrlf
				Response.Write "                item.focus();" & vbCrlf
				Response.Write "                return """&ErrorMsg&""";" & vbCrlf
				Response.Write "            }" & vbCrlf
				Response.Write "        }," & vbCrlf
			ElseIf RsFieldSet("FieldType")="zutu" Then
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = RsFieldSet("ErrorMsg")
				Else
					ErrorMsg = "请至少添加一个" & RsFieldSet("FieldName") & "！"
				End If
				Response.Write "        "&RsFieldSet("Field")&": function (value, item) {" & vbCrlf
				Response.Write "            if ($(""input[name='"&RsFieldSet("Field")&"']"").length<=0){" & vbCrlf
				Response.Write "                return """&ErrorMsg&""";" & vbCrlf
				Response.Write "            }" & vbCrlf
				Response.Write "        }," & vbCrlf
			Else
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = RsFieldSet("ErrorMsg")
				Else
					ErrorMsg = RsFieldSet("FieldName") & "不能为空或填写不正确！"
				End If
				Response.Write "        "&RsFieldSet("Field")&": function (value, item) {" & vbCrlf
				Response.Write "            if (!value){" & vbCrlf
				Response.Write "                item.focus();" & vbCrlf
				Response.Write "                return """&ErrorMsg&""";" & vbCrlf
				Response.Write "            }" & vbCrlf
				If RsFieldSet("MinLength") <> "" Then
					Response.Write "            if (value.length < "&Code_CLng(RsFieldSet("MinLength"))&"){" & vbCrlf
					Response.Write "                item.focus();" & vbCrlf
					Response.Write "                return """&ErrorMsg&""";" & vbCrlf
					Response.Write "            }" & vbCrlf
				End If
				If RsFieldSet("MaxLength") <> "" Then
					Response.Write "            if (value.length > "&Code_CLng(RsFieldSet("MaxLength"))&"){" & vbCrlf
					Response.Write "                item.focus();" & vbCrlf
					Response.Write "                return """&ErrorMsg&""";" & vbCrlf
					Response.Write "            }" & vbCrlf
				End If
				Response.Write "        }," & vbCrlf
			End If
		End If
		RsFieldSet.MoveNext
	Loop
	Response.Write "    });" & vbCrlf
	SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
	Call Exec(RsFieldSet,SqlFieldSet,2)
	Do While Not(RsFieldSet.Eof)
		If RsFieldSet("FieldType")="checkbox" Then
			Response.Write "    //页面加载的时候就初始几个值" & vbCrlf
			Response.Write "    "&RsFieldSet("Field")&"Value();" & vbCrlf
			Response.Write "    //监听复选框" & vbCrlf
			Response.Write "    form.on('checkbox("&RsFieldSet("Field")&")', function (data) {" & vbCrlf
			Response.Write "        var "&RsFieldSet("Field")&" = $('input[name="""&RsFieldSet("Field")&"""]'), value = data.value, array = "&RsFieldSet("Field")&".val().split("","");" & vbCrlf
			Response.Write "        if (data.elem.checked) {" & vbCrlf
			Response.Write "            "&RsFieldSet("Field")&".val("&RsFieldSet("Field")&".val() + value + "","");" & vbCrlf
			Response.Write "        } else {" & vbCrlf
			Response.Write "            var new"&RsFieldSet("Field")&" = """";" & vbCrlf
			Response.Write "            for (var i = 0; i < array.length; i++) {" & vbCrlf
			Response.Write "                var str = array[i];" & vbCrlf
			Response.Write "                new"&RsFieldSet("Field")&" += (str != value && str != """" && str != null) ? str + "","" : """";" & vbCrlf
			Response.Write "            }" & vbCrlf
			Response.Write "            "&RsFieldSet("Field")&".val(new"&RsFieldSet("Field")&");" & vbCrlf
			Response.Write "        }" & vbCrlf
			Response.Write "    });" & vbCrlf
			Response.Write "    /**" & vbCrlf
			Response.Write "    * input 框初始 赋值 到checkedbox上" & vbCrlf
			Response.Write "    * @author lengff" & vbCrlf
			Response.Write "    */" & vbCrlf
			Response.Write "    function "&RsFieldSet("Field")&"Value() {" & vbCrlf
			Response.Write "        var param=$(""input[name='"&RsFieldSet("Field")&"']"").val(),checkBoxs = $(""input[type='checkbox']""), array = param.split("","");" & vbCrlf
			Response.Write "        for (var i = 0; i < array.length; i++) {" & vbCrlf
			Response.Write "            for (var j = 0; j < checkBoxs.length; j++) {" & vbCrlf
			Response.Write "                var checkbox = $(checkBoxs[j]);" & vbCrlf
			Response.Write "                if (checkbox.val() == array[i]) {" & vbCrlf
			Response.Write "                    checkbox.attr('checked','checked');" & vbCrlf
			Response.Write "                    break;" & vbCrlf
			Response.Write "                }" & vbCrlf
			Response.Write "            }" & vbCrlf
			Response.Write "        }" & vbCrlf
			Response.Write "        form.render('checkbox');" & vbCrlf
			Response.Write "    }" & vbCrlf
		End If
		RsFieldSet.MoveNext
	Loop
	Response.Write "    var ClassID = xmSelect.render({" & vbCrLf
	Response.Write "        el: '#ClassID'," & vbCrLf
	Response.Write "        name: 'ClassID'," & vbCrLf
	Response.Write "        layVerify: 'ClassID'," & vbCrLf
	Response.Write "        on: function(data){" & vbCrLf
	Response.Write "            var arr = data.arr;" & vbCrLf
	Response.Write "            var change = data.change;" & vbCrLf
	Response.Write "            var isAdd = data.isAdd;" & vbCrLf
	Response.Write "            if(isAdd){" & vbCrLf
	Response.Write "                changeClassType(change[0].value);" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        radio: true," & vbCrLf
	Response.Write "        clickClose: true," & vbCrLf
	'Response.Write "        tips: '指定栏目的" & ChannelTit & "?'," & vbCrLf
	'Response.Write "        empty: '呀, 没有数据呢'," & vbCrLf
	Response.Write "        autoRow: true," & vbCrLf
	Response.Write "        filterable: true," & vbCrLf
	Response.Write "        height: '300px'," & vbCrLf
	Response.Write "        direction: 'down'," & vbCrLf
	Response.Write "        tree: {" & vbCrLf
	Response.Write "            show: true,//是否显示树状结构" & vbCrLf
	Response.Write "            showFolderIcon: true,//是否展示三角图标" & vbCrLf
	Response.Write "            showLine: true,//是否显示虚线" & vbCrLf
	Response.Write "            indent: 20,//间距" & vbCrLf
	Response.Write "            expandedKeys: true,//默认展开节点的数组, 为 true 时, 展开所有节点" & vbCrLf
	Response.Write "            strict: false,//是否严格遵守父子模式" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        toolbar: {" & vbCrLf
	Response.Write "            show: false," & vbCrLf
	Response.Write "            list: ['ALL', 'REVERSE', 'CLEAR']" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        data: [" & vbCrLf
	Response.Write GetClass_Option(ChannelID, 0, rs("ClassID"))
	Response.Write "        ]" & vbCrLf
	Response.Write "    })" & vbCrLf
	Response.Write "    //监听LinkUrl" & vbCrlf
	Response.Write "    form.on('checkbox(UseLinkUrl)', function(data){" & vbCrlf
	Response.Write "        rUseLinkUrl();" & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //提交监听" & vbCrlf
	Response.Write "    form.on('submit(submit)', function (data) {" & vbCrlf
	Response.Write "        loading = layer.load(1, {shade: [0.1,'#fff']});" & vbCrlf
	Response.Write "        $.ajax({" & vbCrLf
	Response.Write "            type: 'post'," & vbCrLf
	Response.Write "            url: '?Action=SaveModify'," & vbCrLf
	Response.Write "            data: $(data.form).serialize()," & vbCrLf
	Response.Write "            dataType: 'json'," & vbCrLf
	Response.Write "            success: function(res) {" & vbCrLf
	Response.Write "                layer.close(loading);" & vbCrlf
	Response.Write "                if(res.code > 0){" & vbCrlf
	If ChannelIsCreateHtml = True Then
		Response.Write "                    var diag = new Dialog({" & vbCrlf
		Response.Write "                        id:'Create" & ChannelDir & "'," & vbCrlf
		Response.Write "                        title:'正在生成相关数据'," & vbCrlf
		Response.Write "                        url:'Admin_Create" & ChannelDir & ".asp?Action=IndexList&ChannelID='+res.ChannelID+'&ClassID='+res.ClassID+'&id='+res.id+''," & vbCrlf
		Response.Write "                        width:450," & vbCrlf
		Response.Write "                        height:200," & vbCrlf
		Response.Write "                        modal:true" & vbCrlf
		Response.Write "                    });" & vbCrlf
		Response.Write "                    diag.autoClose=1;" & vbCrlf
		Response.Write "                    diag.show();" & vbCrlf
		Response.Write "                    setTimeout(function(){" & vbCrlf
		Response.Write "                        layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
		Response.Write "                            location.href = res.url;" & vbCrlf
		Response.Write "                        });" & vbCrlf
		Response.Write "                    },1500);" & vbCrlf
	Else
		Response.Write "                    layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
		Response.Write "                        location.href = res.url;" & vbCrlf
		Response.Write "                    });" & vbCrlf
	End If
	Response.Write "                }else{" & vbCrlf
	Response.Write "                    layer.msg(res.msg,{icon: 2, time: 1000});" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrLf
	Response.Write "        });" & vbCrLf
	Response.Write "    });" & vbCrlf
	Response.Write "});" & vbCrlf
	Response.Write "</script>" & vbCrlf
	rs.close
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub SaveModify()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID, oIncludeInfo, Title, Tcolor, Subtitle, Subheading, Csid, Keyes, Author, Inputer, CopyFrom, Tim, Hidden, Hits, UseLinkUrl, LinkUrl, Intro, Content, SEOTitle, SEOKeyWord, SEODescript, Moban, SkinID, TemplateID, PaginationType, MaxCharPerPage, PageTitle, Pic, IsPic, UploadFiles, UpdateClasses, OrderID, SqlFieldSet, RsFieldSet, i, Field, ErrorMsg, cRs, aRs
		ID=Trim(Request.Form("ID"))
		sql="Select top 1 * From "&Data_Name&" Where ID="&ID
		Call Exe_Conn(rs,sql,3)
		If rs.eof Then
			rs.close
			Response.Write "{""code"":0,""msg"":"""&ToUnicode(ChannelTit)&"ID\uff08"&ID&"\uff09\u4e0d\u5b58\u5728\uff01""}" & vbCrLf
			Response.End()
		End If
		oIncludeInfo=Code_Form("IncludeInfo")
		Title=Code_Admin("Title",1,255)
		Tcolor=Code_Form("Tcolor")
		If len(Tcolor)<>6 Then Tcolor=""
		Subtitle=Code_Admin("Subtitle",1,255)
		Subheading=Code_Admin("Subheading",1,255)
		Csid=Code_Form("ClassID")
		Keyes=Code_Admin("Keyes",1,255)
		Author=Code_Admin("Author",1,50)
		Inputer=Code_Admin("Inputer",1,50)
		If ChkName(Inputer)=False Then Inputer=Login_Username
		CopyFrom=Code_Admin("CopyFrom",1,255)
		Tim=Code_Admin("Tim",1,20)
		Tim=Time_Type(Tim,1)
		If Tim="" Then Tim=Time_Type(now(),1)
		Hidden=True
		If Code_Form("Hidden")="yes" Then Hidden=False
		Hits=Code_Form("Hits")
		UseLinkUrl=Code_Form("UseLinkUrl")
		LinkUrl=Code_Form("LinkUrl")
		Intro=Code_Remark("Intro")
		Content=Code_Remark("Content")
		If Code_Remark("Remote")="yes" Then Content=DoRemoteUpload(Content,ChannelMaxFileSize,ChannelUpFileType(4),ChannelUploadDir,Get_ChannelSetup(ChannelSetup,15))
		SEOTitle=Code_Form("SEOTitle")
		SEOKeyWord=Code_Form("SEOKeyWord")
		SEODescript=Code_Form("SEODescript")
		Moban=Code_Form("Moban")
		SkinID=Code_Form("SkinID")
		TemplateID=Code_Form("TemplateID")
		PaginationType=Code_Form("PaginationType")
		MaxCharPerPage=Code_Form("MaxCharPerPage")
		PageTitle=Replace(Code_Form("PageTitle"),vbcrlf,"§")
		Pic=Code_Admin("Pic",1,255)
		If Code_Remark("Frist")="yes" And Pic="" Then Pic=Get_Frist_Pic(Content)
		IsPic=True
		If Pic="" Then IsPic=False
		UploadFiles=Replace(Code_Remark("UploadFiles"),"|","@@@")
		dim ZutuNum:ZutuNum=request.form("Zutu").count
		dim Zutuarr
		for i=1 to ZutuNum
			Zutu=trim(request.form("Zutu")(i))
			Zutu=replace(Zutu,chr(13),"")
			Zutu=replace(Zutu,chr(10),"")
			ZutuDesc=trim(request.form("Zutu_desc")(i))
			ZutuDesc=replace(ZutuDesc,chr(13),"")
			ZutuDesc=replace(ZutuDesc,chr(10),"")
			if i>1 then
				Zutuarr=Zutuarr&","
			end if
			Zutuarr=Zutuarr&Zutu&"@@@"&ZutuDesc
		next
		dim Zutu:Zutu=Zutuarr
		
		If Title = "" Then
			Response.Write "{""code"":0,""msg"":""" & ToUnicode(ChannelTit) & "\u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
			Response.End()
		End If
		If Cs_Nd(Csid)=False Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u9009\u62e9" & ToUnicode(ChannelTit) & "\u680f\u76ee\uff01""}" & vbCrLf
			Response.End()
		End If
		SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
		Call Exec(RsFieldSet,SqlFieldSet,2)
		Do While Not(RsFieldSet.Eof)
			If RsFieldSet("FieldType")<>"zutu" Then
				Field = RsFieldSet("Field")
				Field = Code_Form(Field)
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = ToUnicode(RsFieldSet("ErrorMsg"))
				Else
					ErrorMsg = ToUnicode(RsFieldSet("FieldName")) & "\u4e0d\u80fd\u4e3a\u7a7a\u6216\u586b\u5199\u4e0d\u6b63\u786e\uff01"
				End If
				If Field = "" And Code_CLng(RsFieldSet("NotNull"))>0 Then
					Response.Write "{""code"":0,""msg"":""" & ErrorMsg & """}" & vbCrLf
					Response.End()
				End If
				If Code_CLng(RsFieldSet("NotNull"))>0 Then
					If RsFieldSet("MinLength") <> "" Then
						If Len(Field) < Code_CLng(RsFieldSet("MinLength")) Then
							Response.Write "{""code"":0,""msg"":""" & ErrorMsg & """}" & vbCrLf
							Response.End()
						End If
					End If
					If RsFieldSet("MaxLength")<>"" Then
						If Len(Field) > Code_CLng(RsFieldSet("MaxLength")) Then
							Response.Write "{""code"":0,""msg"":""" & ErrorMsg & """}" & vbCrLf
							Response.End()
						End If
					End If
				End If
			End If
			RsFieldSet.MoveNext
		Loop
		If UseLinkUrl = "Yes" Then
			If LinkUrl = "" Or LCase(LinkUrl) = "http://" Then
				Response.Write "{""code"":0,""msg"":""\u94fe\u63a5\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
				Response.End()
			Else
				If InStr(LinkUrl, "://") <= 0 And Left(LinkUrl, 1) <> "/" Then
					Response.Write "{""code"":0,""msg"":""\u672c\u7ad9\u5730\u5740\u8bf7\u4ee5 \/ \u5f00\u5934\u3002""}" & vbCrLf
					Response.End()
				End If
			End If
		Else
			If Content = "" Then
				Response.Write "{""code"":0,""msg"":""" & ToUnicode(ChannelTit) & "\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
				Response.End()
			End If
		End If
		
		If FoundErr=True Then
			Exit Sub
		End If
		
		Call Exec(cRs,"Select top 1 * From "&Data_Name&" Where ID="&ID,2)
			If Code_CLng(cRs("ClassID"))<>Code_CLng(Csid) Then
				Call Exec(aRs,"Select * From " & Data_Name & " Where ChannelID=" & ChannelID & " And IsDelete=" & WK_False & " And ClassID=" & cRs("ClassID") & " And OrderID>" & cRs("OrderID") & " order by ID asc",2)
				Do While Not aRs.EOF
					Call Exec("","Update " & Data_Name & " Set OrderID=OrderID-1 Where ChannelID=" & ChannelID & " And ClassID=" & cRs("ClassID") & " And OrderID>" & cRs("OrderID") & " And ID=" & aRs("ID"),0)
				aRs.movenext
				Loop
				aRs.Close:Set aRs = Nothing

				Call Exec(oRs,"Select Max(OrderID) From " & Data_Name & " Where ClassID=" & Csid,2)
				If IsNull(oRs(0)) Then
					OrderID = 1
				Else
					OrderID = oRs(0) + 1
				End If
				oRs.Close:Set oRs = Nothing
				Call Exec("","Update " & Data_Name & " Set OrderID=" & OrderID & " Where ChannelID=" & ChannelID & " And ID="&ID,0)
			End If
		cRs.Close:Set cRs = Nothing
		
		Call Chk_Cid()
		rs("ChannelID")=ChannelID
		rs("ClassID")=Csid
		rs("IncludeInfo")=oIncludeInfo
		rs("Title")=Title
		rs("Subtitle")=Subtitle
		rs("Subheading")=Subheading
		rs("Tcolor")=Tcolor
		rs("Keyes")=Keyes
		rs("Author")=Author
		rs("Inputer")=Inputer
		rs("CopyFrom")=CopyFrom
		rs("Tim")=Tim
		rs("Hidden")=Hidden
		rs("Hits")=Hits
		rs("LinkUrl")=LinkUrl
		rs("Intro")=Intro
		rs("Content")=Content
		rs("SEOTitle")=SEOTitle
		rs("SEOKeyWord")=SEOKeyWord
		rs("SEODescript")=SEODescript
		rs("Moban")=Moban
		rs("SkinID")=SkinID
		rs("TemplateID")=TemplateID
		rs("PaginationType")=PaginationType
		rs("MaxCharPerPage")=MaxCharPerPage
		rs("PageTitle")=PageTitle
		rs("Pic")=Pic
		rs("IsPic")=IsPic
		rs("UploadFiles")=UploadFiles
		rs("Zutu")=Zutu
		If Is_Null(rs("HtmlFileDate"))="" Then rs("HtmlFileDate")=HtmlRndFileName()
		rs("IsUpdate")=True
		SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
		Call Exec(RsFieldSet,SqlFieldSet,2)
		Do While Not(RsFieldSet.Eof)
			If RsFieldSet("FieldType")="zutu" Then
				Field = RsFieldSet("Field")
				dim FieldNum:FieldNum=request.form(Field).count
				dim Fieldstr,FieldDesc,Fieldarr
				for i=1 to FieldNum
					Fieldstr=trim(request.form(Field)(i))
					Fieldstr=replace(Fieldstr,chr(13),"")
					Fieldstr=replace(Fieldstr,chr(10),"")
					FieldDesc=trim(request.form(Field&"_desc")(i))
					FieldDesc=replace(FieldDesc,chr(13),"")
					FieldDesc=replace(FieldDesc,chr(10),"")
					if i>1 then
						Fieldarr=Fieldarr&","
					end if
					Fieldarr=Fieldarr&Fieldstr&"@@@"&FieldDesc
				next
				rs(Field) = Fieldarr
				Fieldarr = ""
			Else
				Field = RsFieldSet("Field")
				rs(Field) = Code_Form(Field)
			End If
			RsFieldSet.MoveNext
		Loop
		rs.update
		rs.close
		deal_file AdminID,Csid
		UpdateClasses = Exec("","Select ClassParentStr From [Class] Where ChannelID=" & ChannelID & " And ClassID=" & Csid,1)(0)
		Call Exec("","Update Class Set IsUpdate=1 Where ChannelID=" & ChannelID & " And  ClassID in (" & UpdateClasses & ")",0)
		'If ChannelIsCreateHtml = True Then Response.Write "<iframe id='Create" & ChannelDir & "' width='100%' height='210' frameborder='0' src='Admin_Create" & ChannelDir & ".asp?Action=IndexList&ChannelID=" & ChannelID & "&ClassID=" & Csid & "&id=" & ID & "'></iframe>"
		'Response.Write IsConfirm(ChannelTit&"编辑成功！请点击确定，需要继续修改点击取消！","Admin/" & ChannelDir & "/" & strFileName & "?Action=Listing&ChannelID=" & ChannelID & "&ClassID=" & Csid & "","Admin/" & ChannelDir & "/" & strFileName & "?Action=Modify&ChannelID=" & ChannelID & "&ClassID=" & Csid & "&id="&id&"")
		Response.Write "{""code"":1,""msg"":"""&ToUnicode(ChannelTit)&"\u7f16\u8f91\u6210\u529f\uff01"",""ChannelID"":"&ChannelID&",""ClassID"":"&Csid&",""id"":"""&ID&""",""url"":""?Action=Listing&ChannelID=" & ChannelID & "&ClassID=" & Csid & """}" & vbCrLf
		Response.End()
		Exit Sub
	End If
End Sub

Sub Add()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<link href='../Plugins/bootstrap-tagsinput/bootstrap-tagsinput.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script src='../Plugins/bootstrap-tagsinput/bootstrap-tagsinput.min.js' type='text/javascript'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='"&InstallDir&"UEditor/ueditor.config.js'></script>" & vbCrlf
	Response.Write "<script type='text/javascript' src='"&InstallDir&"UEditor/ueditor.all.js'></script>" & vbCrlf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/xm-select/xm-select.js""></script>" & vbCrLf
	Response.Write "</head>" & vbCrlf
	Response.Write "<body>" & vbCrlf
	Dim oIncludeInfo, Title, Tcolor, Subtitle, Subheading, Csid, Keyes, Author, Inputer, CopyFrom, Tim, Hidden, Hits, UseLinkUrl, LinkUrl, Intro, Content, SEOTitle, SEOKeyWord, SEODescript, Moban, SkinID, TemplateID, ContentMoban, ContentSkinID, ContentTemplateID, PaginationType, MaxCharPerPage, PageTitle, Pic, IsPic, UploadFiles, UpdateClasses, OrderID, SqlFieldSet, RsFieldSet, i, Pv_Field, Pv_FieldName, Pv_FieldValue, Pv_FieldType, Pv_FieldOptions, Pv_FieldTips, ErrorMsg, LayVerify, AttrNotNull, OptionTool, Pv_Array, Pv_Array2, Fn_Field
	If ClassID > 0 Then
		Sql="Select * From Class Where ChannelID="&ChannelID&" And ClassID="&ClassID
		Call Exec(Rs,Sql,2)
		If Rs.BOF And Rs.EOF Then
			ContentMoban = ""
			ContentSkinID = ""
			ContentTemplateID = ""
			Rs.Close:Set Rs=Nothing
		Else
			ContentMoban = Rs("ContentMoban")
			ContentSkinID = Rs("ContentSkinID")
			ContentTemplateID = Rs("ContentTemplateID")
			Rs.Close:Set Rs=Nothing
		End If
	Else
		Sql="Select * From Class Where ChannelID="&ChannelID&" Order By ClassOrder Asc,ClassID Asc"
		Call Exec(Rs,Sql,2)
		If Rs.BOF And Rs.EOF Then
			ContentMoban = ""
			ContentSkinID = ""
			ContentTemplateID = ""
			Rs.Close:Set Rs=Nothing
		Else
			ContentMoban = Rs("ContentMoban")
			ContentSkinID = Rs("ContentSkinID")
			ContentTemplateID = Rs("ContentTemplateID")
			Rs.Close:Set Rs=Nothing
		End If
	End If
	Response.Write "<form class='layui-form layui-form-pane' name='myform' action='?Action=SaveAdd&ChannelID=" & ChannelID & "' method='post'>" & vbCrlf
	Response.Write "<input type='hidden' id='upid' name='upid' value=''>" & vbCrlf
	Response.Write "<input type='hidden' id='uppic' name='uppic' value='' onchange=""doChange('uppic','TempUploadFiles','Pic','" & Lcase(InstallDir & UploadSetting(1)) & "','" & Lcase(UploadSetting(1)) & "','" & Lcase(InstallDir) & "','" & Lcase(InstallDir & UploadSetting(1) & "/" & ChannelDir) & "','/" & ChannelDir & "')"">" & vbCrlf
	Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrlf
	Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
	Response.Write "        <legend>添加" & ChannelTit & "</legend>" & vbCrlf
	Response.Write "    </fieldset>" & vbCrlf
	Response.Write "    <div class=""layui-tab"">" & vbCrlf
	Response.Write "        <ul class=""layui-tab-title"">" & vbCrlf
	Response.Write "            <li class=""layui-this"">基本信息</li>" & vbCrlf
	Response.Write "            <li>SEO管理</li>" & vbCrlf
	Response.Write "            <li id=""MobanTag"">模板设置</li>" & vbCrlf
	Response.Write "        </ul>" & vbCrlf
	Response.Write "        <div class=""layui-tab-content"">" & vbCrlf
	Response.Write TopicShowColor(0,"Title","","Tcolor","","Subtitle","","Subheading","","")
	Response.Write Class_InitSelect(ChannelID,ClassID)
	SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle<>1 ORDER BY OrderNum ASC"
	Call Exec(RsFieldSet,SqlFieldSet,2)
	i = 0
	Do While Not(RsFieldSet.Eof)
		Pv_Field = RsFieldSet("Field")
		Pv_FieldName = RsFieldSet("FieldName")
		Pv_FieldValue = RsFieldSet("FieldValue")
		Pv_FieldType = RsFieldSet("FieldType")
		Pv_FieldOptions = RsFieldSet("FieldOptions")
		Pv_FieldTips = RsFieldSet("FieldTips")
		
		If Code_CLng(RsFieldSet("NotNull"))>0 Then
			If RsFieldSet("ErrorMsg")<>"" Then
				ErrorMsg = RsFieldSet("ErrorMsg")
			Else
				ErrorMsg = Pv_FieldName & "不能为空或填写不正确！"
			End If
			If RsFieldSet("Pattern")="required" Then
				LayVerify = " lay-verify="""&Pv_Field&""""
			Else
				LayVerify = " lay-verify="""&Pv_Field&"|"& RsFieldSet("Pattern") &""""
			End If
			If Pv_FieldType="editor" Then
				If i = 0 Then
					AttrNotNull = AttrNotNull & "1|"&Pv_Field&"|"&ErrorMsg&""
				Else
					AttrNotNull = AttrNotNull & ",1|"&Pv_Field&"|"&ErrorMsg&""
				End If
			ElseIf Pv_FieldType="radio" Then
				If i = 0 Then
					AttrNotNull = AttrNotNull & "2|"&Pv_Field&"|"&ErrorMsg&""
				Else
					AttrNotNull = AttrNotNull & ",2|"&Pv_Field&"|"&ErrorMsg&""
				End If
			ElseIf Pv_FieldType="checkbox" Then
				'If i = 0 Then
					'AttrNotNull = AttrNotNull & "3|"&Pv_Field&"|"&ErrorMsg&""
				'Else
					'AttrNotNull = AttrNotNull & ",3|"&Pv_Field&"|"&ErrorMsg&""
				'End If
			Else
				If i = 0 Then
					AttrNotNull = AttrNotNull & "0|"&Pv_Field&"|"&ErrorMsg&""
				Else
					AttrNotNull = AttrNotNull & ",0|"&Pv_Field&"|"&ErrorMsg&""
				End If
			End If
			i = i + 1
		End If
		
		Select Case Pv_FieldType
		Case "text"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""" class=""layui-input"""& LayVerify &">&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "textarea"
			Response.Write "                <div class=""layui-form-item layui-form-text"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-block"">" & vbCrlf
			Response.Write "                        <textarea type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" rows=""4"" cols=""80"" maxlength=""255"""& LayVerify &" class=""layui-textarea"">"& Pv_FieldValue &"</textarea>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "editor"
			If RsFieldSet("OptionMode")=2 Then
				OptionTool=OptionTool&"'Source','Undo', 'Redo','|','Bold','Italic','Underline','ForeColor','BackColor','|','FontFamily', 'FontSize','|','JustifyLeft','JustifyCenter','JustifyRight','JustifyJustify','|','Simpleupload','Insertimage','Link','Unlink','AutoTypeSet','FullScreen'"
			ElseIf RsFieldSet("OptionMode")=3 Then
				OptionTool=OptionTool&"'Source', '|', "&RsFieldSet("OptionTool")&",'|','Fullscreen'"
			Else
				OptionTool=OptionTool&"'Fullscreen', 'Source', '|', 'Undo', 'Redo', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Bold', 'Italic', 'Underline', 'Fontborder', 'Strikethrough', 'Superscript', 'Subscript', 'Removeformat', 'Formatmatch', 'Autotypeset', 'Blockquote', 'Pasteplain', '|', 'Forecolor', 'Backcolor', 'Insertorderedlist', 'Insertunorderedlist', 'Selectall', 'Cleardoc', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Rowspacingtop', 'Rowspacingbottom', 'Lineheight', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Customstyle', 'Paragraph', 'Fontfamily', 'Fontsize', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Directionalityltr', 'Directionalityrtl', 'Indent', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Justifyleft', 'Justifycenter', 'Justifyright', 'Justifyjustify', '|', 'Touppercase', 'Tolowercase', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Link', 'Unlink', 'Anchor', '|', 'Imagenone', 'Imageleft', 'Imageright', 'Imagecenter', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Simpleupload', 'Insertimage', 'Emotion', 'Scrawl', 'Insertvideo', 'Music', 'Attachment', 'Map', 'Insertframe', 'Insertcode', 'Pagebreak', 'Template', 'Background', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Horizontal', 'Date', 'Time', 'Spechars', 'Wordimage', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Inserttable', 'Deletetable', 'Insertparagraphbeforetable', 'Insertrow', 'Deleterow', 'Insertcol', 'Deletecol', 'Mergecells', 'Mergeright', 'Mergedown', 'Splittocells', 'Splittorows', 'Splittocols', 'Charts', '|',"
				OptionTool=OptionTool&Vbcrlf&"'Print', 'Preview', 'Searchreplace', 'Help'"
			End If
			Response.Write "                <div class=""layui-form-item layui-form-text"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-block"">" & vbCrlf
			Response.Write "                        <textarea id='"&Pv_Field&"' name='"&Pv_Field&"'"& LayVerify &">"&Pv_FieldValue&"</textarea>"
			Response.Write "                        <script type=""text/javascript"">"
			Response.Write "                        var editor = UE.getEditor('"&Pv_Field&"',{serverUrl:'"&InstallDir&AdminFolder&"/Include/Upload.asp?channelid=" & ChannelID & "&classid=" & ClassID & "',toolbars:[["&OptionTool&"]],initialFrameWidth:'100%',initialFrameHeight:'160'});"
			Response.Write "                        </script>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "radio"
			Pv_Array = Split(Pv_FieldOptions,",")
			Fn_Temp = ""
			For Pv_ii=0 To Ubound(Pv_Array)
				Fn_Temp = Fn_Temp &"<input type=""radio"" name="""& Pv_Field &""" "& Check_Object(Pv_FieldValue,Split(Pv_Array(Pv_ii),"|")(0)," checked") &" value="""& Split(Pv_Array(Pv_ii),"|")(0) &""" title="""&Split(Pv_Array(Pv_ii),"|")(1)&""" lay-verify="""&Pv_Field&""">"
			Next
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        "& Fn_Temp &"&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "checkbox"
			Pv_Array = Split(Pv_FieldOptions,",")
			Fn_Temp = ""
			For Pv_ii=0 To Ubound(Pv_Array)
				Fn_Temp = Fn_Temp &"<input type=""checkbox"" lay-filter="""& Pv_Field &""" "& Check_Object(Pv_FieldValue,Split(Pv_Array(Pv_ii),"|")(0)," checked") &" value="""& Split(Pv_Array(Pv_ii),"|")(0) &""" title="""&Split(Pv_Array(Pv_ii),"|")(1)&""">"
			Next
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""hidden"" name="""& Pv_Field &""" value="""& Pv_FieldValue &""""& LayVerify &">"& Fn_Temp &"&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "select"
			Pv_Array = Split(Pv_FieldOptions,",")
			Fn_Temp = ""
			For Pv_ii=0 To Ubound(Pv_Array)
				Fn_Temp = Fn_Temp &"_data.push(['"& Split(Pv_Array(Pv_ii),"|")(0) &"','"& Split(Pv_Array(Pv_ii),"|")(1) &"']);"
			Next
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <div id="""& Pv_Field &"_outer"" ztype=""select"" class=""z-combox"" style=""display:inline-block; *zoom: 1;*display: inline;vertical-align:middle;height:auto;width:auto;position:relative;border:none 0;margin:0;padding:0;white-space: nowrap;"" _style=""width:150px;""><input type=""text"" ztype=""select"" id="""& Pv_Field &""" name="""& Pv_Field &""" tabindex=""-1"" autocomplete=""off"" class=""inputText"" style=""width:150px;position:absolute;z-index:-1;"" value=""" & Pv_FieldValue & """ startvalue=""" & Pv_FieldValue & """"& LayVerify &"/><input type=""text"" id="""& Pv_Field &"_textField"" autocomplete=""off"" class=""inputText"" style=""vertical-align:middle; cursor:default;width:150px;"" /><a id="""& Pv_Field &"_spinner"" class=""z-combox-spinner"" style=""position:relative; left:-17px; margin-right:-15px; cursor:pointer; width:13px; height:15px;vertical-align:middle;""><b></b></a><div id="""& Pv_Field &"_list"" class=""optgroup"" style=""text-align:left;display:none;""><div id="""& Pv_Field &"_ul"" style=""left:-1px; width:-1px;""><script>Combox_"& Pv_Field &"_Init=function(){var _el=Zving.getDom('"& Pv_Field &"');if(_el._components){return true;}var  _data=[];var  _DataSource;_data.push(['','请选择...']);"& Fn_Temp &"var combox_"& Pv_Field &" = new Zving.Selector({el:_el,data:_data,DataSource:_DataSource});};if(Zving.Page.isReady){Combox_"& Pv_Field &"_Init();}else{Zving.Page.onReady(Combox_"& Pv_Field &"_Init);}</script></div></div></div>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "number"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" class=""TxtClass slong"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""" onblur=""this.value=this.value.replace(/[^0-9.]*/g,'');"""& LayVerify &" />&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "datetime"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""""& LayVerify &" />&nbsp;<button type=""button"" class=""layui-btn"" hidefocus=""true"" onClick=""SelectTime('"& Pv_Field &"','yyyy-MM-dd HH:mm:ss','','');"">选择</button>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                        <script>" & vbCrlf
			Response.Write "                        layui.use(""laydate"", function () {" & vbCrlf
			Response.Write "                            var laydate = layui.laydate;" & vbCrlf
			Response.Write "                            laydate.render({" & vbCrlf
			Response.Write "                                elem: ""#"& Pv_Field &"""," & vbCrlf
			Response.Write "                                type:""datetime""," & vbCrlf
			Response.Write "                                format:""yyyy-MM-dd HH:mm:ss""" & vbCrlf
			Response.Write "                            });" & vbCrlf
			Response.Write "                        })" & vbCrlf
			Response.Write "                        </script>" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "image"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""""& LayVerify &" />" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""SelectFile('"&ChannelID&"','"&ChannelModuleType&"','1','1','"&Pv_Field&"','','','','0','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">浏览</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""UploadFile('"&ChannelID&"','"&ChannelModuleType&"','1','0','"&ClassID&"','1','0','0','"&Pv_Field&"','','','','','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">上传</button>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case "zutu"
			Response.Write Info_ZuTu(ChannelID,Pv_Field,Pv_FieldName,Pv_Field&"ImageArea",Pv_FieldValue,"Pic","TempUploadFiles",LayVerify,Pv_FieldTips)
		Case "file"
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""""& LayVerify &" />" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                    <div class=""layui-input-2"">" & vbCrlf
			Response.Write "                        <button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""SelectFile('"&ChannelID&"','"&ChannelModuleType&"','3','1','"&Pv_Field&"','','','','0','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">浏览</button><button type=""button"" class=""layui-btn"" hidefocus=""true"" onclick=""UploadFile('"&ChannelID&"','"&ChannelModuleType&"','2','0','"&ClassID&"','1','0','0','"&Pv_Field&"','','','','','" & InstallDir & UploadSetting(1) & "','" & UploadSetting(1) & "','" & InstallDir & "','" & InstallDir & UploadSetting(1) & "/" & ChannelDir & "','/" & ChannelDir & "');"">上传</button>&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		Case Else
			Response.Write "                <div class=""layui-form-item"">" & vbCrlf
			Response.Write "                    <label class=""layui-form-label"">"& Pv_FieldName &"：</label>" & vbCrlf
			Response.Write "                    <div class=""layui-input-4"">" & vbCrlf
			Response.Write "                        <input type=""text"" id="""& Pv_Field &""" name="""& Pv_Field &""" size=""30"" maxlength=""255"" value="""& Pv_FieldValue &""" class=""layui-input"""& LayVerify &">&nbsp;"& Pv_FieldTips &"" & vbCrlf
			Response.Write "                    </div>" & vbCrlf
			Response.Write "                </div>" & vbCrlf
		End Select
		RsFieldSet.MoveNext
	Loop
	Response.Write KeyWord_Init(ChannelID,"")
	Response.Write Info_Derivation(Login_UserName,Login_UserName,SiteName,now(),"","",ChannelID)
	Response.Write Info_Init(RemoteTrue,FristTrue,True,0)
	Response.Write Html_LinkUrl("")
	Response.Write Html_Edit("","Intro","简介","","Content","内容","","100%",350)
	Response.Write Html_Page("",0,10000,"")
	Response.Write Info_FrmUpload(ChannelID,Pic,"Pic",0,"首页图片","图片",0,0,"TempUploadFiles")
	Response.Write Info_UploadList("Pic","图片","","","TempUploadFiles")
	Response.Write Info_ZuTu(ChannelID,"Zutu","组图","ImageArea","","Pic","TempUploadFiles","","")
	Response.Write Html_SEO("","","")
	Response.Write Html_Moban("",ContentMoban,ContentSkinID,ContentTemplateID,ChannelID)
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "</div>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write Submit_Layui("提交添加","重新填写","确认要清空对话框内容？","javascript:history.back();","返回上一页"," onclick=""PostUrl('myform','TempUploadFiles','UploadFiles');""") & vbCrlf
	Response.Write "</form>" & vbCrlf
	Response.Write "<script>" & vbCrlf
	Response.Write "layui.use(['form','element'], function () {" & vbCrlf
	Response.Write "    var form = layui.form,element = layui.element;" & vbCrlf
	Response.Write "    //自定义表单验证" & vbCrlf
	Response.Write "    form.verify({" & vbCrlf
	Response.Write "        Title: function (value, item) {" & vbCrlf
	Response.Write "            if (!value){" & vbCrlf
	Response.Write "                item.focus();" & vbCrlf
	Response.Write "                return """ & ChannelTit & "标题不能为空！"";" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "        ClassID: function (value, item) {" & vbCrlf
	Response.Write "            if (!value || value == '0'){" & vbCrlf
	Response.Write "                item.focus();" & vbCrlf
	Response.Write "                return ""请选择" & ChannelTit & "栏目！"";" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "        Content: function (value, item) {" & vbCrlf
	Response.Write "            if($(""input:checkbox[name='UseLinkUrl']:checked"").val()!=""Yes""){" & vbCrlf
	Response.Write "                if (!UE.getEditor('Content').getContent()){" & vbCrlf
	Response.Write "                    UE.getEditor('Content').focus();" & vbCrlf
	Response.Write "                    return """ & ChannelTit & "内容不能为空！"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	Response.Write "        LinkUrl: function (value, item) {" & vbCrlf
	Response.Write "            if($(""input:checkbox[name='UseLinkUrl']:checked"").val()==""Yes""){" & vbCrlf
	Response.Write "                if (!value){" & vbCrlf
	Response.Write "                    item.focus();" & vbCrlf
	Response.Write "                    return ""链接地址不能为空！"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "                if (value.indexOf('://') == -1 && value.substr(0, 1) != '/'){" & vbCrlf
	Response.Write "                    item.select();" & vbCrlf
	Response.Write "                    return ""本站地址请以 \/ 开头。"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "                if (value.indexOf('://') != -1 && !(/(^#)|(^http(s*):\/\/[^\s]+\.[^\s]+)/.test(value))){" & vbCrlf
	Response.Write "                    item.select();" & vbCrlf
	Response.Write "                    return ""链接格式不正确！"";" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrlf
	Response.Write "        }," & vbCrlf
	SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
	Call Exec(RsFieldSet,SqlFieldSet,2)
	Do While Not(RsFieldSet.Eof)
		If Code_CLng(RsFieldSet("NotNull"))>0 Then
			If RsFieldSet("FieldType")="radio" Then
				Pv_FieldArray = Split(RsFieldSet("FieldOptions"),",")
				Fn_Field = ""
				For Pv_ii=0 To Ubound(Pv_FieldArray)
					If Pv_ii=0 Then
						Fn_Field = Fn_Field &"val == """& Split(Pv_FieldArray(Pv_ii),"|")(0) &""""
					Else
						Fn_Field = Fn_Field &" || val == """& Split(Pv_FieldArray(Pv_ii),"|")(0) &""""
					End If
				Next
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = RsFieldSet("ErrorMsg")
				Else
					ErrorMsg = RsFieldSet("FieldName") & "不能为空或填写不正确！"
				End If
				Response.Write "        "&RsFieldSet("Field")&": function (value, item) {" & vbCrlf
				Response.Write "            var val = $(""input:radio[name='"&RsFieldSet("Field")&"']:checked"").val();" & vbCrlf
				Response.Write "            if (!("&Fn_Field&")){" & vbCrlf
				Response.Write "                item.focus();" & vbCrlf
				Response.Write "                return """&ErrorMsg&""";" & vbCrlf
				Response.Write "            }" & vbCrlf
				Response.Write "        }," & vbCrlf
			ElseIf RsFieldSet("FieldType")="zutu" Then
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = RsFieldSet("ErrorMsg")
				Else
					ErrorMsg = "请至少添加一个" & RsFieldSet("FieldName") & "！"
				End If
				Response.Write "        "&RsFieldSet("Field")&": function (value, item) {" & vbCrlf
				Response.Write "            if ($(""input[name='"&RsFieldSet("Field")&"']"").length<=0){" & vbCrlf
				Response.Write "                return """&ErrorMsg&""";" & vbCrlf
				Response.Write "            }" & vbCrlf
				Response.Write "        }," & vbCrlf
			Else
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = RsFieldSet("ErrorMsg")
				Else
					ErrorMsg = RsFieldSet("FieldName") & "不能为空或填写不正确！"
				End If
				Response.Write "        "&RsFieldSet("Field")&": function (value, item) {" & vbCrlf
				Response.Write "            if (!value){" & vbCrlf
				Response.Write "                item.focus();" & vbCrlf
				Response.Write "                return """&ErrorMsg&""";" & vbCrlf
				Response.Write "            }" & vbCrlf
				If RsFieldSet("MinLength") <> "" Then
					Response.Write "            if (value.length < "&Code_CLng(RsFieldSet("MinLength"))&"){" & vbCrlf
					Response.Write "                item.focus();" & vbCrlf
					Response.Write "                return """&ErrorMsg&""";" & vbCrlf
					Response.Write "            }" & vbCrlf
				End If
				If RsFieldSet("MaxLength") <> "" Then
					Response.Write "            if (value.length > "&Code_CLng(RsFieldSet("MaxLength"))&"){" & vbCrlf
					Response.Write "                item.focus();" & vbCrlf
					Response.Write "                return """&ErrorMsg&""";" & vbCrlf
					Response.Write "            }" & vbCrlf
				End If
				Response.Write "        }," & vbCrlf
			End If
		End If
		RsFieldSet.MoveNext
	Loop
	Response.Write "    });" & vbCrlf
	SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
	Call Exec(RsFieldSet,SqlFieldSet,2)
	Do While Not(RsFieldSet.Eof)
		If RsFieldSet("FieldType")="checkbox" Then
			Response.Write "    //页面加载的时候就初始几个值" & vbCrlf
			Response.Write "    "&RsFieldSet("Field")&"Value();" & vbCrlf
			Response.Write "    //监听复选框" & vbCrlf
			Response.Write "    form.on('checkbox("&RsFieldSet("Field")&")', function (data) {" & vbCrlf
			Response.Write "        var "&RsFieldSet("Field")&" = $('input[name="""&RsFieldSet("Field")&"""]'), value = data.value, array = "&RsFieldSet("Field")&".val().split("","");" & vbCrlf
			Response.Write "        if (data.elem.checked) {" & vbCrlf
			Response.Write "            "&RsFieldSet("Field")&".val("&RsFieldSet("Field")&".val() + value + "","");" & vbCrlf
			Response.Write "        } else {" & vbCrlf
			Response.Write "            var new"&RsFieldSet("Field")&" = """";" & vbCrlf
			Response.Write "            for (var i = 0; i < array.length; i++) {" & vbCrlf
			Response.Write "                var str = array[i];" & vbCrlf
			Response.Write "                new"&RsFieldSet("Field")&" += (str != value && str != """" && str != null) ? str + "","" : """";" & vbCrlf
			Response.Write "            }" & vbCrlf
			Response.Write "            "&RsFieldSet("Field")&".val(new"&RsFieldSet("Field")&");" & vbCrlf
			Response.Write "        }" & vbCrlf
			Response.Write "    });" & vbCrlf
			Response.Write "    /**" & vbCrlf
			Response.Write "    * input 框初始 赋值 到checkedbox上" & vbCrlf
			Response.Write "    * @author lengff" & vbCrlf
			Response.Write "    */" & vbCrlf
			Response.Write "    function "&RsFieldSet("Field")&"Value() {" & vbCrlf
			Response.Write "        var param=$(""input[name='"&RsFieldSet("Field")&"']"").val(),checkBoxs = $(""input[type='checkbox']""), array = param.split("","");" & vbCrlf
			Response.Write "        for (var i = 0; i < array.length; i++) {" & vbCrlf
			Response.Write "            for (var j = 0; j < checkBoxs.length; j++) {" & vbCrlf
			Response.Write "                var checkbox = $(checkBoxs[j]);" & vbCrlf
			Response.Write "                if (checkbox.val() == array[i]) {" & vbCrlf
			Response.Write "                    checkbox.attr('checked','checked');" & vbCrlf
			Response.Write "                    break;" & vbCrlf
			Response.Write "                }" & vbCrlf
			Response.Write "            }" & vbCrlf
			Response.Write "        }" & vbCrlf
			Response.Write "        form.render('checkbox');" & vbCrlf
			Response.Write "    }" & vbCrlf
		End If
		RsFieldSet.MoveNext
	Loop
	Response.Write "    var ClassID = xmSelect.render({" & vbCrLf
	Response.Write "        el: '#ClassID'," & vbCrLf
	Response.Write "        name: 'ClassID'," & vbCrLf
	Response.Write "        layVerify: 'ClassID'," & vbCrLf
	Response.Write "        on: function(data){" & vbCrLf
	Response.Write "            var arr = data.arr;" & vbCrLf
	Response.Write "            var change = data.change;" & vbCrLf
	Response.Write "            var isAdd = data.isAdd;" & vbCrLf
	Response.Write "            if(isAdd){" & vbCrLf
	Response.Write "                changeClassType(change[0].value);" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        radio: true," & vbCrLf
	Response.Write "        clickClose: true," & vbCrLf
	'Response.Write "        tips: '指定栏目的" & ChannelTit & "?'," & vbCrLf
	'Response.Write "        empty: '呀, 没有数据呢'," & vbCrLf
	Response.Write "        autoRow: true," & vbCrLf
	Response.Write "        filterable: true," & vbCrLf
	Response.Write "        height: '300px'," & vbCrLf
	Response.Write "        direction: 'down'," & vbCrLf
	Response.Write "        tree: {" & vbCrLf
	Response.Write "            show: true,//是否显示树状结构" & vbCrLf
	Response.Write "            showFolderIcon: true,//是否展示三角图标" & vbCrLf
	Response.Write "            showLine: true,//是否显示虚线" & vbCrLf
	Response.Write "            indent: 20,//间距" & vbCrLf
	Response.Write "            expandedKeys: true,//默认展开节点的数组, 为 true 时, 展开所有节点" & vbCrLf
	Response.Write "            strict: false,//是否严格遵守父子模式" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        toolbar: {" & vbCrLf
	Response.Write "            show: false," & vbCrLf
	Response.Write "            list: ['ALL', 'REVERSE', 'CLEAR']" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        data: [" & vbCrLf
	Response.Write GetClass_Option(ChannelID, 0, ClassID)
	Response.Write "        ]" & vbCrLf
	Response.Write "    })" & vbCrLf
	Response.Write "    //监听LinkUrl" & vbCrlf
	Response.Write "    form.on('checkbox(UseLinkUrl)', function(data){" & vbCrlf
	Response.Write "        rUseLinkUrl();" & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //提交监听" & vbCrlf
	Response.Write "    form.on('submit(submit)', function (data) {" & vbCrlf
	Response.Write "        loading = layer.load(1, {shade: [0.1,'#fff']});" & vbCrlf
	Response.Write "        $.ajax({" & vbCrLf
	Response.Write "            type: 'post'," & vbCrLf
	Response.Write "            url: '?Action=SaveAdd'," & vbCrLf
	Response.Write "            data: $(data.form).serialize()," & vbCrLf
	Response.Write "            dataType: 'json'," & vbCrLf
	Response.Write "            success: function(res) {" & vbCrLf
	Response.Write "                layer.close(loading);" & vbCrlf
	Response.Write "                if(res.code > 0){" & vbCrlf
	If ChannelIsCreateHtml = True Then
		Response.Write "                    if($(""input:checkbox[name='Hidden']:checked"").val()!=""yes""){" & vbCrlf
		Response.Write "                        var diag = new Dialog({" & vbCrlf
		Response.Write "                            id:'Create" & ChannelDir & "'," & vbCrlf
		Response.Write "                            title:'正在生成相关数据'," & vbCrlf
		Response.Write "                            url:'Admin_Create" & ChannelDir & ".asp?Action=IndexList&ChannelID='+res.ChannelID+'&ClassID='+res.ClassID+'&id='+res.id+''," & vbCrlf
		Response.Write "                            width:450," & vbCrlf
		Response.Write "                            height:200," & vbCrlf
		Response.Write "                            modal:true" & vbCrlf
		Response.Write "                        });" & vbCrlf
		Response.Write "                        diag.autoClose=1;" & vbCrlf
		Response.Write "                        diag.show();" & vbCrlf
		Response.Write "                        setTimeout(function(){" & vbCrlf
		Response.Write "                            layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
		Response.Write "                                location.href = res.url;" & vbCrlf
		Response.Write "                            });" & vbCrlf
		Response.Write "                        },1500);" & vbCrlf
		Response.Write "                    }else{" & vbCrlf
		Response.Write "                        layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
		Response.Write "                            location.href = res.url;" & vbCrlf
		Response.Write "                        });" & vbCrlf
		Response.Write "                    }" & vbCrlf
	Else
		Response.Write "                    layer.msg(res.msg,{icon: 1, time: 1000},function(){" & vbCrlf
		Response.Write "                        location.href = res.url;" & vbCrlf
		Response.Write "                    });" & vbCrlf
	End If
	Response.Write "                }else{" & vbCrlf
	Response.Write "                    layer.msg(res.msg,{icon: 2, time: 1000});" & vbCrlf
	Response.Write "                }" & vbCrlf
	Response.Write "            }" & vbCrLf
	Response.Write "        });" & vbCrLf
	Response.Write "    });" & vbCrlf
	Response.Write "});" & vbCrlf
	Response.Write "</script>" & vbCrlf
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub SaveAdd()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID, oIncludeInfo, Title, Tcolor, Subtitle, Subheading, Csid, Keyes, Author, Inputer, CopyFrom, Tim, Hidden, Hits, UseLinkUrl, LinkUrl, Intro, Content, SEOTitle, SEOKeyWord, SEODescript, Moban, SkinID, TemplateID, ContentMoban, ContentSkinID, ContentTemplateID, PaginationType, MaxCharPerPage, PageTitle, Pic, IsPic, UploadFiles, UpdateClasses, OrderID, SqlFieldSet, RsFieldSet, i, Field, ErrorMsg
		oIncludeInfo=Code_Form("IncludeInfo")
		Title=Code_Admin("Title",1,255)
		Tcolor=Code_Form("Tcolor")
		If len(Tcolor)<>6 Then Tcolor=""
		Subtitle=Code_Admin("Subtitle",1,255)
		Subheading=Code_Admin("Subheading",1,255)
		Csid=Code_Form("ClassID")
		Keyes=Code_Admin("Keyes",1,255)
		Author=Code_Admin("Author",1,50)
		Inputer=Code_Admin("Inputer",1,50)
		If ChkName(Inputer)=False Then Inputer=Login_Username
		CopyFrom=Code_Admin("CopyFrom",1,255)
		Tim=Code_Admin("Tim",1,20)
		Tim=Time_Type(Tim,1)
		If Tim="" Then Tim=Time_Type(now(),1)
		Hidden=True
		If Code_Form("Hidden")="yes" Then Hidden=False
		Hits=Code_Form("Hits")
		UseLinkUrl=Code_Form("UseLinkUrl")
		LinkUrl=Code_Form("LinkUrl")
		Intro=Code_Remark("Intro")
		Content=Code_Remark("Content")
		If Code_Remark("Remote")="yes" Then Content=DoRemoteUpload(Content,ChannelMaxFileSize,ChannelUpFileType(4),ChannelUploadDir,Get_ChannelSetup(ChannelSetup,15))
		SEOTitle=Code_Form("SEOTitle")
		SEOKeyWord=Code_Form("SEOKeyWord")
		SEODescript=Code_Form("SEODescript")
		Moban=Code_Form("Moban")
		SkinID=Code_Form("SkinID")
		TemplateID=Code_Form("TemplateID")
		PaginationType=Code_Form("PaginationType")
		MaxCharPerPage=Code_Form("MaxCharPerPage")
		PageTitle=Replace(Code_Form("PageTitle"),vbcrlf,"§")
		Pic=Code_Admin("Pic",1,255)
		If Code_Remark("Frist")="yes" And Pic="" Then Pic=Get_Frist_Pic(Content)
		IsPic=True
		If Pic="" Then IsPic=False
		UploadFiles=Replace(Code_Remark("UploadFiles"),"|","@@@")
		dim ZutuNum:ZutuNum=request.form("Zutu").count
		dim Zutuarr
		for i=1 to ZutuNum
			Zutu=trim(request.form("Zutu")(i))
			Zutu=replace(Zutu,chr(13),"")
			Zutu=replace(Zutu,chr(10),"")
			ZutuDesc=trim(request.form("Zutu_desc")(i))
			ZutuDesc=replace(ZutuDesc,chr(13),"")
			ZutuDesc=replace(ZutuDesc,chr(10),"")
			if i>1 then
				Zutuarr=Zutuarr&","
			end if
			Zutuarr=Zutuarr&Zutu&"@@@"&ZutuDesc
		next
		dim Zutu:Zutu=Zutuarr
		
		If Title = "" Then
			Response.Write "{""code"":0,""msg"":""" & ToUnicode(ChannelTit) & "\u6807\u9898\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
			Response.End()
		End If
		If Cs_Nd(Csid)=False Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u9009\u62e9" & ToUnicode(ChannelTit) & "\u680f\u76ee\uff01""}" & vbCrLf
			Response.End()
		End If
		SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
		Call Exec(RsFieldSet,SqlFieldSet,2)
		Do While Not(RsFieldSet.Eof)
			If RsFieldSet("FieldType")<>"zutu" Then
				Field = RsFieldSet("Field")
				Field = Code_Form(Field)
				If RsFieldSet("ErrorMsg")<>"" Then
					ErrorMsg = ToUnicode(RsFieldSet("ErrorMsg"))
				Else
					ErrorMsg = ToUnicode(RsFieldSet("FieldName")) & "\u4e0d\u80fd\u4e3a\u7a7a\u6216\u586b\u5199\u4e0d\u6b63\u786e\uff01"
				End If
				If Field = "" And Code_CLng(RsFieldSet("NotNull"))>0 Then
					Response.Write "{""code"":0,""msg"":""" & ErrorMsg & """}" & vbCrLf
					Response.End()
				End If
				If Code_CLng(RsFieldSet("NotNull"))>0 Then
					If RsFieldSet("MinLength") <> "" Then
						If Len(Field) < Code_CLng(RsFieldSet("MinLength")) Then
							Response.Write "{""code"":0,""msg"":""" & ErrorMsg & """}" & vbCrLf
							Response.End()
						End If
					End If
					If RsFieldSet("MaxLength")<>"" Then
						If Len(Field) > Code_CLng(RsFieldSet("MaxLength")) Then
							Response.Write "{""code"":0,""msg"":""" & ErrorMsg & """}" & vbCrLf
							Response.End()
						End If
					End If
				End If
			End If
			RsFieldSet.MoveNext
		Loop
		If UseLinkUrl = "Yes" Then
			If LinkUrl = "" Or LCase(LinkUrl) = "http://" Then
				Response.Write "{""code"":0,""msg"":""\u94fe\u63a5\u5730\u5740\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
				Response.End()
			Else
				If InStr(LinkUrl, "://") <= 0 And Left(LinkUrl, 1) <> "/" Then
					Response.Write "{""code"":0,""msg"":""\u672c\u7ad9\u5730\u5740\u8bf7\u4ee5 \/ \u5f00\u5934\u3002""}" & vbCrLf
					Response.End()
				End If
			End If
		Else
			If Content = "" Then
				Response.Write "{""code"":0,""msg"":""" & ToUnicode(ChannelTit) & "\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\uff01""}" & vbCrLf
				Response.End()
			End If
		End If
		
		If FoundErr=True Then
			Exit Sub
		End If
		
		Call Chk_Cid()
		Call Exec(Rs,"Select Max(OrderID) From "&Data_Name&" Where ClassID="&Csid,2)
		If IsNull(rs(0)) Then
			OrderID = 1
		Else
			OrderID = rs(0) + 1
		End If
		rs.close
		
		ID = GetNewID(Data_Name, "ID")
		sql="Select * From "&Data_Name
		Call Exe_Conn(rs,sql,3)
		rs.addnew
		rs("ID")=ID
		rs("ChannelID")=ChannelID
		rs("ClassID")=Csid
		rs("IncludeInfo")=oIncludeInfo
		rs("Title")=Title
		rs("Subtitle")=Subtitle
		rs("Subheading")=Subheading
		rs("Tcolor")=Tcolor
		rs("Keyes")=Keyes
		rs("Author")=Author
		rs("Inputer")=Inputer
		rs("CopyFrom")=CopyFrom
		rs("Tim")=Tim
		rs("Hidden")=Hidden
		rs("Hits")=Hits
		rs("LinkUrl")=LinkUrl
		rs("Intro")=Intro
		rs("Content")=Content
		rs("SEOTitle")=SEOTitle
		rs("SEOKeyWord")=SEOKeyWord
		rs("SEODescript")=SEODescript
		rs("Moban")=Moban
		rs("SkinID")=SkinID
		rs("TemplateID")=TemplateID
		rs("PaginationType")=PaginationType
		rs("MaxCharPerPage")=MaxCharPerPage
		rs("PageTitle")=PageTitle
		rs("Pic")=Pic
		rs("IsPic")=IsPic
		rs("UploadFiles")=UploadFiles
		rs("Zutu")=Zutu
		rs("HtmlFileDate")=HtmlRndFileName()
		rs("IsUpdate")=True
		rs("OrderID")=OrderID
		SqlFieldSet = "SELECT * FROM [FieldSet] WHERE ChannelID="& ChannelID &" AND Recycle=0 ORDER BY OrderNum ASC"
		Call Exec(RsFieldSet,SqlFieldSet,2)
		Do While Not(RsFieldSet.Eof)
			If RsFieldSet("FieldType")="zutu" Then
				Field = RsFieldSet("Field")
				dim FieldNum:FieldNum=request.form(Field).count
				dim Fieldarr
				for i=1 to FieldNum
					Fieldstr=trim(request.form(Field)(i))
					Fieldstr=replace(Fieldstr,chr(13),"")
					Fieldstr=replace(Fieldstr,chr(10),"")
					FieldDesc=trim(request.form(Field&"_desc")(i))
					FieldDesc=replace(FieldDesc,chr(13),"")
					FieldDesc=replace(FieldDesc,chr(10),"")
					if i>1 then
						Fieldarr=Fieldarr&","
					end if
					Fieldarr=Fieldarr&Fieldstr&"@@@"&FieldDesc
				next
				rs(Field) = Fieldarr
				Fieldarr = ""
			Else
				Field = RsFieldSet("Field")
				rs(Field) = Code_Form(Field)
			End If
			RsFieldSet.MoveNext
		Loop
		rs.update
		rs.close
		deal_file AdminID,Csid
		UpdateClasses = Exec("","Select ClassParentStr From [Class] Where ChannelID=" & ChannelID & " And ClassID=" & Csid,1)(0)
		Call Exec("","Update Class Set IsUpdate=1 Where ChannelID=" & ChannelID & " And  ClassID in (" & UpdateClasses & ")",0)
		'If ChannelIsCreateHtml = True Then Response.Write "<iframe id='Create" & ChannelDir & "' width='100%' height='210' frameborder='0' src='Admin_Create" & ChannelDir & ".asp?Action=IndexList&ChannelID=" & ChannelID & "&ClassID=" & Csid & "&id=" & ID & "'></iframe>"
		'Response.Write IsConfirm(ChannelTit&"添加成功！请点击确定，需要继续添加点击取消！","Admin/" & ChannelDir & "/" & strFileName & "?Action=Listing&ChannelID=" & ChannelID & "&ClassID=" & Csid & "","Admin/" & ChannelDir & "/" & strFileName & "?Action=Add&ChannelID=" & ChannelID & "&ClassID=" & Csid & "")
		Response.Write "{""code"":1,""msg"":"""&ToUnicode(ChannelTit)&"\u6dfb\u52a0\u6210\u529f\uff01"",""ChannelID"":"&ChannelID&",""ClassID"":"&Csid&",""id"":"""&ID&""",""url"":""?Action=Listing&ChannelID=" & ChannelID & "&ClassID=" & Csid & """}" & vbCrLf
		Response.End()
		Exit Sub
	End If
End Sub

Sub Main()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/Default.css' rel='stylesheet' type='text/css'>" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "</head>" & vbCrlf
	Response.Write "<body>" & vbCrlf
	Response.Write "<section id=""iframecontent"">" & vbCrlf
	Response.Write "  <section class=""treelistframe pull-left"">" & vbCrlf
	Response.Write "    <iframe width=""190px"" name=""treemain"" id=""treemain"" frameborder=""false"" scrolling=""auto"" height=""auto"" allowtransparency=""true"" frameborder=""0"" src=""?Action=LeftList&ChannelID=" & ChannelID & """></iframe>" & vbCrlf
	Response.Write "  </section>" & vbCrlf
	Response.Write "  <section class=""openclose pull-left"">" & vbCrlf
	Response.Write "    <a href=""javascript:OpenClose();"" id=""openclose"" onmouseover=""layer.tips('展开与关闭',this,{tips: [1, '#000']});"" onmouseout=""layer.closeAll();""><i class=""fa fa-chevron-left""></i></a>" & vbCrlf
	Response.Write "  </section>" & vbCrlf
	Response.Write "  <section id=""iframecontent"">" & vbCrlf
	Response.Write "    <iframe width=""100%"" name=""iframeid"" id=""iframeid"" frameborder=""false"" scrolling=""auto"" height=""auto"" allowtransparency=""true"" frameborder=""0"" src=""?Action=Listing&ChannelID=" & ChannelID & "&ClassID=" & ClassID & """></iframe>" & vbCrlf
	Response.Write "  </section>" & vbCrlf
	Response.Write "</section>" & vbCrlf
	Response.Write "<script src=""../Js/contentiframe.js""></script>" & vbCrLf
	Response.Write "<script>" & vbCrlf
	Response.Write "layui.use(['layer'], function () {" & vbCrlf
	Response.Write "    var layer = layui.layer;" & vbCrlf
	Response.Write "});" & vbCrlf
	Response.Write "</script>" & vbCrlf
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub LeftList()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/Default.css' rel='stylesheet' type='text/css'>" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "</head>" & vbCrlf
	Response.Write "<body>" & vbCrlf
	Dim HiddenNum, DeleteNum
	HiddenNum = dbcount(Data_Name,"ChannelID=" & ChannelID & " And Hidden=" & WK_False & "")
	DeleteNum = dbcount(Data_Name,"ChannelID=" & ChannelID & " And IsDelete=" & WK_True & "")
	Response.Write Left_List_Class(ChannelID,HiddenNum,DeleteNum)
	Response.Write "<script>" & vbCrlf
	Response.Write "layui.use(['layer'], function () {" & vbCrlf
	Response.Write "    var layer = layui.layer;" & vbCrlf
	Response.Write "});" & vbCrlf
	Response.Write "</script>" & vbCrlf
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub Listing()
	Dim Status,t1
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim Rs,Sql,RsClassList,SqlClassList,RsArticleList,SqlArticleList,tmp_ChildStr,ClassName,ClassUrl,HtmlFileName,HtmlFileUrl,Hidden,Title,Pic,Tim,data,i,iCount
		Status = ReplaceBadChar(Trim(Code_Form("Status")))
		ChannelID = Code_CLng(Trim(Code_Form("ChannelID")))
		ClassID = Code_CLng(Trim(Code_Form("ClassID")))
		Sql="Select ClassChildStr From Class Where ChannelID=" & ChannelID
		If ClassID<>0 Then
			Sql=Sql & " And ClassID in (" & ClassID & ")"
		End If
		Call Exe_Conn(Rs,Sql,1)
		If Rs.eof and rs.bof Then
			tmp_ChildStr = 0
		Else
			tmp_ChildStr = Rs("ClassChildStr")
		End If
		
		SqlArticleList = "Select * From "&Data_Name&" Where ChannelID=" & ChannelID
		If Status="0" Then
			SqlArticleList = SqlArticleList & " And IsDelete=" & WK_True
		Else
			SqlArticleList = SqlArticleList & " And IsDelete=" & WK_False
		End If
		If Code_Form("ClassID")<>"" And Code_Form("ClassID")<>"0" And tmp_ChildStr<>0 Then SqlArticleList = SqlArticleList & " And ClassID in ("&tmp_ChildStr&")"
		If Status="1" Then
			SqlArticleList = SqlArticleList & " And Hidden=" & WK_False
		Else
			If Status<>"0" Then SqlArticleList = SqlArticleList & " And Hidden=" & WK_True
		End If
		If Code_Form("sea_type")="ID" Then
			If Code_Form("sea_type")<>"" And Code_Form("Keyword")<>"" Then SqlArticleList = SqlArticleList & " And " & Code_Form("sea_type") & "=" & Code_CLng(Trim(Code_Form("Keyword"))) & ""
		ElseIf Code_Form("sea_type")="Inputer" Then
			If Code_Form("sea_type")<>"" And Code_Form("Keyword")<>"" Then SqlArticleList = SqlArticleList & " And " & Code_Form("sea_type") & "='" & Code_Form("Keyword") & "'"
		Else
			If Code_Form("sea_type")<>"" And Code_Form("Keyword")<>"" Then SqlArticleList = SqlArticleList & " And " & Code_Form("sea_type") & " like '%" & Code_Form("Keyword") & "%'"
		End If
		If Code_Form("ClassID")<>"" And Code_Form("ClassID")<>"0" And tmp_ChildStr<>0 Then
			SqlArticleList = SqlArticleList & " Order By OrderID Desc,ID Desc"
		Else
			SqlArticleList = SqlArticleList & " Order By ID Desc"
		End If
		Call Exe_Conn(RsArticleList,SqlArticleList,1)
		i = 0
		If RsArticleList.BOF And RsArticleList.EOF Then
			RsArticleList.Close
			Set RsArticleList = Nothing
			data = ""
		Else
			If Request("Page") <> "" Then
				CurrentPage = Code_CLng(Request("Page"))
			Else
				CurrentPage = 1
			End If
			MaxPerPage = Code_CLng(Trim(Request("limit")))
			If MaxPerPage <= 0 Then MaxPerPage = 10
			totalPut = RsArticleList.RecordCount
			If CurrentPage < 1 Then
				CurrentPage = 1
			End If
			If (CurrentPage - 1) * MaxPerPage > totalPut Then
				If (totalPut Mod MaxPerPage) = 0 Then
					CurrentPage = totalPut \ MaxPerPage
				Else
					CurrentPage = totalPut \ MaxPerPage + 1
				End If
			End If
			If CurrentPage > 1 Then
				If (CurrentPage - 1) * MaxPerPage < totalPut Then
					RsArticleList.Move (CurrentPage - 1) * MaxPerPage
				Else
					CurrentPage = 1
				End If
			End If
			Do While Not RsArticleList.EOF
				SqlClassList="select * from Class where ChannelID=" & ChannelID & " And ClassID=" & RsArticleList("ClassID") & " Order By ClassID,ClassOrder,ClassDepth Asc"
				Call Exe_Conn(RsClassList,SqlClassList,1)
				If RsClassList.eof And RsClassList.bof Then
					ClassName=""
				Else
					ClassName = ToUnicode(RsClassList("ClassName"))
					If ChannelIsCreateHtml = True Then
						ClassUrl = InstallDir & ChannelDir & "/" & RsClassList("HtmlFileDir") & "Index" & ChannelHtmlExtName
					Else
						ClassUrl = InstallDir & ChannelDir & "/List.asp?ClassID=" & RsClassList("ClassID")
					End If
				End If
				ClassUrl = Replace(ClassUrl,"/","\/")
				'If RsArticleList("LinkUrl") = "" Then
					If ChannelIsCreateHtml = True Then
						HtmlFileName = ReadFileName(RsArticleList("HtmlFileDate"), RsArticleList("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, "")
						HtmlFileUrl = InstallDir & ChannelDir & "/" & RsClassList("HtmlFileDir") & ShowDatePath(RsArticleList("HtmlFileDate"), ChannelHtmlPath) & HtmlFileName
					Else
						HtmlFileUrl = InstallDir & ChannelDir & "/View.asp?id=" & RsArticleList("ID")
					End If
				'Else
					'HtmlFileUrl = RsArticleList("LinkUrl")
				'End If
				HtmlFileUrl = Replace(HtmlFileUrl,"/","\/")
				Hidden = RsArticleList("Hidden")
				Title = ToUnicode(RsArticleList("Title"))
				If RsArticleList("IsPic") = False Then
					Pic = ""
				Else
					Pic = Replace(Replace(RsArticleList("Pic"),"{$download_dir}",InstallDir & UploadSetting(1)),"/","\/")
				End If
				If RsArticleList("Tim") <> "" Then Tim = Time_Type(RsArticleList("Tim"),1)
				If i=0 Then
					data = data & "{""ID"":"&RsArticleList("ID")&",""ChannelID"":"&RsArticleList("ChannelID")&",""ClassID"":"&RsArticleList("ClassID")&",""Title"":"""&Title&""",""ClassUrl"":"""&ClassUrl&""",""ClassName"":"""&ClassName&""",""Pic"":"""&Pic&""",""Hits"":"""&RsArticleList("Hits")&""",""Tim"":"""&Tim&""",""OrderID"":"""&RsArticleList("OrderID")&""",""HtmlFileUrl"":"""&HtmlFileUrl&""",""Tcolor"":"""&RsArticleList("Tcolor")&""",""IsPic"":"""&RsArticleList("IsPic")&""",""Hidden"":"""&Hidden&""",""IsDelete"":"""&RsArticleList("IsDelete")&"""}"
				Else
					data = data & ",{""ID"":"&RsArticleList("ID")&",""ChannelID"":"&RsArticleList("ChannelID")&",""ClassID"":"&RsArticleList("ClassID")&",""Title"":"""&Title&""",""ClassUrl"":"""&ClassUrl&""",""ClassName"":"""&ClassName&""",""Pic"":"""&Pic&""",""Hits"":"""&RsArticleList("Hits")&""",""Tim"":"""&Tim&""",""OrderID"":"""&RsArticleList("OrderID")&""",""HtmlFileUrl"":"""&HtmlFileUrl&""",""Tcolor"":"""&RsArticleList("Tcolor")&""",""IsPic"":"""&RsArticleList("IsPic")&""",""Hidden"":"""&Hidden&""",""IsDelete"":"""&RsArticleList("IsDelete")&"""}"
				End If
				iCount = iCount + 1
				If iCount >= MaxPerPage Then Exit Do
				RsArticleList.MoveNext
				i=i+1
			Loop
			RsArticleList.Close
			Set RsArticleList = Nothing
		End If
		If totalPut = 0 Then
			Response.Write "{""code"":201,""msg"":""\u65e0\u6570\u636e""}" & vbCrLf
		Else
			Response.Write "{""code"":0,""msg"":""\u83b7\u53d6\u6210\u529f!"",""count"":"&totalPut&",""data"":["&data&"],""rel"":1}" & vbCrLf
		End If
		Response.End()
	Else
		Status = ReplaceBadChar(Trim(Request("Status")))
		If Status="0" Then
			sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Recycle' Order By sort Asc,AuthID Asc"
			Call Exec(rsAuth,sqlAuth,2)
			If rsAuth.BOF And rsAuth.EOF Then
				CheckPurview 0,0
			Else
				CheckPurview rsAuth(0),0
			End If
			rsAuth.Close
			Set rsAuth = Nothing
		ElseIf Status="1" Then
			sqlAuth = "Select AuthID From Admin_Auth Where pid="&PurviewID&" And href='" & ChannelDir & "/Passed' Order By sort Asc,AuthID Asc"
			Call Exec(rsAuth,sqlAuth,2)
			If rsAuth.BOF And rsAuth.EOF Then
				CheckPurview 0,0
			Else
				CheckPurview rsAuth(0),0
			End If
			rsAuth.Close
			Set rsAuth = Nothing
		End If
		Response.Write "<!DOCTYPE html>" & vbCrLf
		Response.Write "<head>" & vbCrLf
		Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
		Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
		Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
		Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
		Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
		Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
		Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
		Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
		Response.Write "<link href='../Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
		Response.Write "<link href='../Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
		Response.Write "<script type='text/javascript'>" & vbCrLf
		Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
		Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
		Response.Write "</script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
		Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
		Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
		Response.Write "<script type=""text/javascript"" src=""../Plugins/bootstrap/bootstrap.min.js""></script>" & vbCrLf
		Response.Write "</head>" & vbCrlf
		Response.Write "<body>" & vbCrlf
		Select Case Status
			Case "0":t1="回收站"
			Case "1":t1="审核"
			Case "2":t1="重新排序"
			Case Else:t1="列表"
		End Select
		Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrlf
		Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
		Response.Write "        <legend>" & ChannelTit & t1 & "</legend>" & vbCrlf
		Response.Write "    </fieldset>" & vbCrlf
		Response.Write "    <div class=""demoTable"">" & vbCrlf
		Response.Write "        <div class=""layui-inline"">" & vbCrlf
		Response.Write "            <input class=""layui-input"" name=""Keyword"" id=""Keyword"" placeholder=""请输入关键字"">" & vbCrlf
		Response.Write "        </div>" & vbCrlf
		Response.Write "<div id=""sea_type_outer"" ztype=""select"" class=""z-combox"" style=""display:inline-block; *zoom: 1;*display: inline;vertical-align:middle;height:auto;width:auto;position:relative;border:none 0;margin:0;padding:0;white-space: nowrap;"" _style=""width:80px;""><input type=""text"" ztype=""select"" id=""sea_type"" name=""sea_type"" tabindex=""-1"" autocomplete=""off"" class=""inputText"" style=""width:80px;position:absolute;z-index:-1;"" value=""" & Code_Form("sea_type") & """ startvalue=""" & Code_Form("sea_type") & """/><input type=""text"" id=""sea_type_textField"" autocomplete=""off"" class=""inputText"" style=""vertical-align:middle; cursor:default;width:80px;"" /><a id=""sea_type_spinner"" class=""z-combox-spinner"" style=""position:relative; left:-17px; margin-right:-15px; cursor:pointer; width:13px; height:15px;vertical-align:middle;""><b></b></a><div id=""sea_type_list"" class=""optgroup"" style=""text-align:left;display:none;""><div id=""sea_type_ul"" style=""left:-1px; width:-1px;""><script>Combox_sea_type_Init=function(){var _el=Zving.getDom('sea_type');if(_el._components){return true;}var  _data=[];var  _DataSource;_data.push(['title','按标题']);_data.push(['Inputer','按发布人']);_data.push(['ID','按" & ChannelTit & "ID']);var combox_sea_type = new Zving.Selector({el:_el,data:_data,DataSource:_DataSource});};if(Zving.Page.isReady){Combox_sea_type_Init();}else{Zving.Page.onReady(Combox_sea_type_Init);}</script></div></div></div>" & vbCrlf
		Response.Write "        <button class=""layui-btn"" id=""search"" data-type=""reload""><i class=""fa fa-search""></i> 搜索</button>" & vbCrlf
		Response.Write "        <a href=""?Action=Listing&ChannelID="&ChannelID&""" class=""layui-btn""><i class=""fa fa-list""></i> 显示全部</a>" & vbCrlf
		Response.Write "        <div style=""clear: both;""></div>" & vbCrlf
		Response.Write "    </div>" & vbCrlf
		Response.Write "    <table class=""layui-table"" id=""list"" lay-filter=""list""></table>" & vbCrlf
		Response.Write "</div>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""order"">" & vbCrlf
		Response.Write "    <input name=""{{d.ID}}"" data-id=""{{d.ID}}"" class=""list_order layui-input"" value=""{{d.OrderID}}"" size=""10""/>" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""title"">" & vbCrlf
		Response.Write "    {{# if(d.Hidden=='False'){ }}" & vbCrLf
		Response.Write "    <font color=""#FF0000"">{{d.Title}}</font>" & vbCrlf
		Response.Write "    {{# } else { }}" & vbCrLf
		Response.Write "    {{# if(d.Tcolor){ }}" & vbCrLf
		Response.Write "    <font color=""#{{d.Tcolor}}"">{{d.Title}}</font>" & vbCrlf
		Response.Write "    {{# } else { }}" & vbCrLf
		Response.Write "    {{d.Title}}" & vbCrlf
		Response.Write "    {{# } }}" & vbCrLf
		Response.Write "    {{# } }}" & vbCrLf
		Response.Write "    {{# if(d.Pic){ }}<img src=""../images/image.gif"" onmouseover=""layer.tips('<img src={{d.Pic}}>',this,{tips: [1, '#fff']});"" onmouseout=""layer.closeAll();"">{{# } }}" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""classname"">" & vbCrlf
		Response.Write "    <a href=""{{d.ClassUrl}}"" target=""_blank"" class=""layui-btn layui-btn-xs layui-btn-normal"">{{d.ClassName}}</a>" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""ispic"">" & vbCrlf
		Response.Write "    {{# if(d.IsPic=='True'){ }}<span class=""layui-btn layui-btn-xs layui-btn-primary"">图</span>{{# } }}" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""action"">" & vbCrlf
		Response.Write "    {{# if(d.IsDelete=='True'){ }}" & vbCrLf
		Response.Write "    <a class=""layui-btn layui-btn-xs"" lay-event=""Restore"">还原</a>" & vbCrlf
		Response.Write "    <a class=""layui-btn layui-btn-danger layui-btn-xs"" lay-event=""ConfirmDel"">彻底删除</a>" & vbCrlf
		Response.Write "    {{# } else { }}" & vbCrLf
		Response.Write "    <a href=""{{d.HtmlFileUrl}}"" target=""_blank"" class=""layui-btn layui-btn-xs layui-btn-normal"">访问</a>" & vbCrlf
		Response.Write "    <a href=""?Action=Modify&ChannelID={{d.ChannelID}}&id={{d.ID}}"" class=""layui-btn layui-btn-xs"">编辑</a>" & vbCrlf
		Response.Write "    <a class=""layui-btn layui-btn-danger layui-btn-xs"" lay-event=""Del"">删除</a>" & vbCrlf
		If ChannelIsCreateHtml = True Then Response.Write "    <a class=""layui-btn layui-btn-danger layui-btn-inverse layui-btn-xs"" lay-event=""DelFile"">删除文件</a>" & vbCrlf
		Response.Write "    {{# } }}" & vbCrLf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script type=""text/html"" id=""topBtn"">" & vbCrlf
		If ClassID<>0 And Status="" Then Response.Write "    <a href=""?Action=Add&ChannelID=" & ChannelID & "&ClassID=" & ClassID & """ class=""layui-btn layui-btn-sm""><i class=""fa fa-plus""></i> 添加" & ChannelTit & "</a>" & vbCrlf
		Response.Write "    <button type=""button"" class=""layui-btn layui-btn-sm layui-btn-normal"" id=""dropdown"" data-toggle=""dropdown""><i class=""fa fa-files-o""></i> 批量操作" & vbCrlf
		Response.Write "        <div class=""dropdown dropdown-bottom-left"">" & vbCrlf
		If Status="0" Then
			Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""ConfirmDel""><i class=""fa fa-trash-o""></i> 彻底删除</a>" & vbCrlf
			Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""ClearRecycleBin""><i class=""fa fa-trash-o""></i> 清空回收站</a>" & vbCrlf
			Response.Write "            <div class=""dropdown-line""></div>" & vbCrlf
			Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""Restore""><i class=""fa fa-reply-all""></i> 还原选定" & ChannelTit & "</a>" & vbCrlf
			Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""RestoreAll""><i class=""fa fa-reply-all""></i> 还原所有" & ChannelTit & "</a>" & vbCrlf
		Else
			Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""BatchReplace""><i class=""fa fa-window-restore""></i> 批量替换</a>" & vbCrlf
			Response.Write "            <div class=""dropdown-line""></div>" & vbCrlf
			If Status="1" Then
				Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""SetePassed""><i class=""fa fa-check-square-o""></i> 审核通过</a>" & vbCrlf
			Else
				Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""CancelPassed""><i class=""fa fa-check""></i> 取消审核</a>" & vbCrlf
			End If
			If ClassID<>0 And Status="" Then Response.Write "            <div class=""dropdown-line""></div>" & vbCrlf
			If ClassID<>0 And Status="" Then Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""Move""><i class=""fa fa-arrows""></i> 批量移动</a>" & vbCrlf
			Response.Write "            <div class=""dropdown-line""></div>" & vbCrlf
			Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""DelAll""><i class=""fa fa-trash-o""></i> 放入回收站</a>" & vbCrlf
			If ChannelIsCreateHtml = True Then Response.Write "            <a href=""javascript:;"" class=""dropdown-item"" id=""DelFile""><i class=""fa fa-trash-o""></i> 删除HTML文件</a>" & vbCrlf
		End If
		Response.Write "        </div>" & vbCrlf
		Response.Write "    </button>" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "<script>" & vbCrlf
		Response.Write "    layui.use('table', function() {" & vbCrlf
		Response.Write "        var table = layui.table, $ = layui.jquery;" & vbCrlf
		Response.Write "        var tableIn = table.render({" & vbCrlf
		Response.Write "            id: 'content'," & vbCrlf
		Response.Write "            elem: '#list'," & vbCrlf
		Response.Write "            url: '?Action=Listing'," & vbCrlf
		Response.Write "            method: 'post'," & vbCrlf
		Response.Write "            where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"',Status:'"&Status&"'}," & vbCrlf
		Response.Write "            toolbar: '#topBtn'," & vbCrlf
		Response.Write "            cellMinWidth: 80," & vbCrLf
		Response.Write "            page: true," & vbCrlf
		Response.Write "            cols: [[" & vbCrlf
		Response.Write "                {type: ""checkbox"", fixed: true}," & vbCrlf
		Response.Write "                {field: 'ID', title: '编号', width: 80, fixed: true}," & vbCrlf
		Response.Write "                {field: 'Title', title: '" & ChannelTit & "标题', width: 280, templet: '#title'}," & vbCrlf
		Response.Write "                {field: 'ClassName',  title: '所属栏目', width: 150, templet: '#classname'}," & vbCrlf
		Response.Write "                {field: 'Hits',  title: '点击', width: 80}," & vbCrlf
		Response.Write "                {field: 'IsPic',  title: '" & ChannelTit & "属性', width: 100, templet: '#ispic'}," & vbCrlf
		Response.Write "                {field: 'Tim', title: '添加时间', width: 160}," & vbCrlf
		If ClassID<>0 And Status="" Then Response.Write "                {field: 'OrderID', align: 'center', title: '排序', width: 80, templet: '#order'}," & vbCrlf
		Response.Write "                {width: 240, align: 'center', toolbar: '#action',title:'操作'}" & vbCrlf
		Response.Write "            ]]," & vbCrlf
		Response.Write "            limit: 10" & vbCrlf
		Response.Write "        });" & vbCrlf
		Response.Write "        //搜索" & vbCrlf
		Response.Write "        $('#search').on('click', function () {" & vbCrlf
		Response.Write "            var Keyword = $('#Keyword').val();" & vbCrlf
		Response.Write "            var sea_type = $('#sea_type').val();" & vbCrlf
		Response.Write "            if ($.trim(Keyword) === '') {" & vbCrlf
		Response.Write "                layer.msg('请输入关键字！', {icon: 0});" & vbCrlf
		Response.Write "                return;" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "            tableIn.reload({ page: {page: 1}, where: {Keyword: Keyword,sea_type: sea_type,ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'} });" & vbCrlf
		Response.Write "        });" & vbCrlf
		Response.Write "        $('body').on('blur','.list_order',function() {" & vbCrlf
		Response.Write "            var ID = $(this).attr('data-id');" & vbCrlf
		Response.Write "            var OrderID = $(this).val();" & vbCrlf
		Response.Write "            var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "            $.ajax({" & vbCrLf
		Response.Write "                type: 'post'," & vbCrLf
		Response.Write "                url: '?Action=ListOrder'," & vbCrLf
		Response.Write "                data: {ID:ID,OrderID:OrderID,ChannelID:"&ChannelID&",ClassID:"&ClassID&"}," & vbCrLf
		Response.Write "                dataType: 'json'," & vbCrLf
		Response.Write "                success: function(res) {" & vbCrLf
		Response.Write "                    layer.close(loading);" & vbCrLf
		Response.Write "                    if (res.code == 1) {" & vbCrLf
		Response.Write "                        layer.msg(res.msg, {time: 1000, icon: 1}, function () {" & vbCrlf
		Response.Write "                            location.href = res.url;" & vbCrlf
		Response.Write "                        });" & vbCrlf
		Response.Write "                    }else{" & vbCrLf
		Response.Write "                        layer.msg(res.msg,{time:1000,icon:2});" & vbCrlf
		Response.Write "                    }" & vbCrLf
		Response.Write "                }" & vbCrLf
		Response.Write "            });" & vbCrLf
		Response.Write "        });" & vbCrlf
		Response.Write "        table.on('tool(list)', function(obj) {" & vbCrlf
		Response.Write "            var data = obj.data;" & vbCrlf
		Response.Write "            if(obj.event === 'Del'){" & vbCrlf
		Response.Write "                layer.confirm('确定要删除此" & ChannelTit & "内容吗？删除后你可以从" & ChannelTit & "回收站还原它！', {icon: 3}, function(index){" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=Del'," & vbCrLf
		Response.Write "                        data: {ID:data.ID}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "            if(obj.event === 'Restore'){" & vbCrlf
		Response.Write "                layer.confirm('确定要还原此" & ChannelTit & "吗？', {icon: 3}, function(index){" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=Restore'," & vbCrLf
		Response.Write "                        data: {ID:data.ID}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "            if(obj.event === 'ConfirmDel'){" & vbCrlf
		Response.Write "                layer.confirm('确定要彻底删除此" & ChannelTit & "内容吗？', {icon: 3}, function(index){" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=ConfirmDel'," & vbCrLf
		Response.Write "                        data: {ID:data.ID}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "            if(obj.event === 'DelFile'){" & vbCrlf
		Response.Write "                layer.confirm('确定要删除此" & ChannelTit & "的HTML页面吗？', {icon: 3}, function(index){" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=DelFile'," & vbCrLf
		Response.Write "                        data: {ID:data.ID}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
		Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "        });" & vbCrlf
		Response.Write "        $('body').on('click','#BatchReplace',function() {" & vbCrlf
		Response.Write "            window.location.href='?Action=BatchReplace&ChannelID="&ChannelID&"';" & vbCrlf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#Move',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                var diag = new Dialog({" & vbCrlf
		Response.Write "                    id:'Move'," & vbCrlf
		Response.Write "                    title:'批量移动'," & vbCrlf
		Response.Write "                    url:'" & strFileName & "?Action=Tree&ClassID="&ClassID&"'," & vbCrlf
		Response.Write "                    width:320," & vbCrlf
		Response.Write "                    height:310," & vbCrlf
		Response.Write "                    modal:true" & vbCrlf
		Response.Write "                });" & vbCrlf
		Response.Write "                diag.onOk = function(){" & vbCrlf
		Response.Write "                    var t0 = $DW.$V(""#go"");" & vbCrlf
		Response.Write "                    if(t0==""""||t0=="&ClassID&") {" & vbCrlf
		Response.Write "                        Dialog.alert(""\u4e0d\u80fd\u79fb\u52a8\u5230\u5f53\u524d\u680f\u76ee"");" & vbCrlf
		Response.Write "                        return false" & vbCrlf
		Response.Write "                    }" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=Move'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"',go:t0}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ClassList=2&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=3;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },3500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                    diag.close();" & vbCrlf
		Response.Write "                };" & vbCrlf
		Response.Write "                diag.onCancel=function(){" & vbCrlf
		Response.Write "                    $DW.close();" & vbCrlf
		Response.Write "                };" & vbCrlf
		Response.Write "                diag.show();" & vbCrlf
		Response.Write "            }" & vbCrlf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#SetePassed',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                layer.confirm('确定要将选中的" & ChannelTit & "审核通过吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=SetePassed'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrLf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#CancelPassed',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                layer.confirm('确定要将选中的" & ChannelTit & "取消审核吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=CancelPassed'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrLf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#Restore',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                layer.confirm('确定要还原选定的" & ChannelTit & "吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=Restore'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrLf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#RestoreAll',function() {" & vbCrlf
		Response.Write "            layer.confirm('确定要还原所有" & ChannelTit & "吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                layer.close(index);" & vbCrlf
		Response.Write "                var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                $.ajax({" & vbCrLf
		Response.Write "                    type: 'post'," & vbCrLf
		Response.Write "                    url: '?Action=RestoreAll'," & vbCrLf
		Response.Write "                    data: {ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                    dataType: 'json'," & vbCrLf
		Response.Write "                    success: function(res) {" & vbCrLf
		Response.Write "                        layer.close(loading);" & vbCrLf
		Response.Write "                        if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                            if (res.id=='') {" & vbCrLf
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                            }else{" & vbCrLf
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
			Response.Write "                            }" & vbCrLf
		Else
			Response.Write "                            layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                            tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                        }else{" & vbCrLf
		Response.Write "                            layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    }" & vbCrLf
		Response.Write "                });" & vbCrLf
		Response.Write "            });" & vbCrlf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#DelAll',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                layer.confirm('确定要将选中的" & ChannelTit & "内容吗？删除后你可以从" & ChannelTit & "回收站还原它！', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=Del'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrLf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#ConfirmDel',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                layer.confirm('确定要将选中的" & ChannelTit & "彻底删除吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=ConfirmDel'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
		Else
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrLf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#ClearRecycleBin',function() {" & vbCrlf
		Response.Write "            layer.confirm('确定要清空回收站吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                layer.close(index);" & vbCrlf
		Response.Write "                var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                $.ajax({" & vbCrLf
		Response.Write "                    type: 'post'," & vbCrLf
		Response.Write "                    url: '?Action=ClearRecycleBin'," & vbCrLf
		Response.Write "                    data: {ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                    dataType: 'json'," & vbCrLf
		Response.Write "                    success: function(res) {" & vbCrLf
		Response.Write "                        layer.close(loading);" & vbCrLf
		Response.Write "                        if (res.code==1) {" & vbCrLf
		If ChannelIsCreateHtml = True Then
			Response.Write "                            if (res.id=='') {" & vbCrLf
			Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                            }else{" & vbCrLf
			Response.Write "                                var diag = new Dialog({" & vbCrlf
			Response.Write "                                    id:'Create" & ChannelDir & "'," & vbCrlf
			Response.Write "                                    title:'正在生成相关数据'," & vbCrlf
			Response.Write "                                    url:'Admin_Create" & ChannelDir & ".asp?Action=ListCont&ChannelID="&ChannelID&"&Csid='+res.ClassID+'&id='+res.id+''," & vbCrlf
			Response.Write "                                    width:450," & vbCrlf
			Response.Write "                                    height:200," & vbCrlf
			Response.Write "                                    modal:true" & vbCrlf
			Response.Write "                                });" & vbCrlf
			Response.Write "                                diag.autoClose=1;" & vbCrlf
			Response.Write "                                diag.show();" & vbCrlf
			Response.Write "                                setTimeout(function(){" & vbCrlf
			Response.Write "                                    layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                                    tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
			Response.Write "                                },1500);" & vbCrlf
			Response.Write "                            }" & vbCrLf
		Else
			Response.Write "                            layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
			Response.Write "                            tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		End If
		Response.Write "                        }else{" & vbCrLf
		Response.Write "                            layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    }" & vbCrLf
		Response.Write "                });" & vbCrLf
		Response.Write "            });" & vbCrlf
		Response.Write "        })" & vbCrlf
		Response.Write "        $('body').on('click','#DelFile',function() {" & vbCrlf
		Response.Write "            var checkStatus = table.checkStatus('content'); //content即为参数id设定的值" & vbCrlf
		Response.Write "            var ids = [];" & vbCrlf
		Response.Write "            $(checkStatus.data).each(function (i, o) {" & vbCrlf
		Response.Write "                ids.push(o.ID);" & vbCrlf
		Response.Write "            });" & vbCrlf
		Response.Write "            if(ids.toString()=="""") {" & vbCrlf
		Response.Write "                layer.msg(""\u81f3\u5c11\u9009\u62e9\u4e00\u6761\u4fe1\u606f"",{time:1000,icon:2});" & vbCrlf
		Response.Write "            } else {" & vbCrlf
		Response.Write "                layer.confirm('确定要删除选中" & ChannelTit & "的HTML页面吗？', {icon: 3}, function(index) {" & vbCrlf
		Response.Write "                    layer.close(index);" & vbCrlf
		Response.Write "                    var loading = layer.load(1, {shade: [0.1, '#fff']});" & vbCrlf
		Response.Write "                    $.ajax({" & vbCrLf
		Response.Write "                        type: 'post'," & vbCrLf
		Response.Write "                        url: '?Action=DelFile'," & vbCrLf
		Response.Write "                        data: {ID: ids.toString(),ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}," & vbCrLf
		Response.Write "                        dataType: 'json'," & vbCrLf
		Response.Write "                        success: function(res) {" & vbCrLf
		Response.Write "                            layer.close(loading);" & vbCrLf
		Response.Write "                            if (res.code==1) {" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:1});" & vbCrLf
		Response.Write "                                tableIn.reload({where:{ChannelID:'"&ChannelID&"',ClassID:'"&ClassID&"'}});" & vbCrlf
		Response.Write "                            }else{" & vbCrLf
		Response.Write "                                layer.msg(res.msg,{time:1000,icon:2});" & vbCrLf
		Response.Write "                            }" & vbCrLf
		Response.Write "                        }" & vbCrLf
		Response.Write "                    });" & vbCrLf
		Response.Write "                });" & vbCrlf
		Response.Write "            }" & vbCrLf
		Response.Write "        })" & vbCrlf
		Response.Write "    });" & vbCrlf
		Response.Write "</script>" & vbCrlf
		Response.Write "</body>" & vbCrLf & "</html>"
	End If
End Sub

Sub ListOrder()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		ID = Code_CLng(Trim(Code_Form("ID")))
		ChannelID = Code_CLng(Trim(Code_Form("ChannelID")))
		ClassID = Code_CLng(Trim(Code_Form("ClassID")))
		OrderID = Code_CLng(Trim(Code_Form("OrderID")))
		Call Exec("","Update ["&Data_Name&"] Set OrderID="&OrderID&" Where ID="&ID,0)
		Response.Write "{""msg"":""\u6392\u5e8f\u6210\u529f\uff01"",""url"":""?Action=Listing&ChannelID="&ChannelID&"&ClassID="&ClassID&""",""code"":1}"
		Response.End()
	End If
End Sub

Sub Tree()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>管理页面</title>" & vbCrLf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/global.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link href='../Style/font.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" href=""../Plugins/zTree/css/zTreeStyle.css"" type=""text/css"">" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/zTree/js/jquery.ztree.core.min.js""></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/zTree/js/jquery.ztree.excheck.min.js""></script>" & vbCrLf
	Response.Write "<script>" & vbCrLf
	Response.Write "var setting={check:{enable:true,chkStyle:""radio"",radioType:""all""},data:{simpleData:{enable:true}},callback:{onCheck:onCheck}};" & vbCrLf
	Response.Write "var zNodes=["
	Sql="Select * From Class Where ChannelID="&ChannelID&" Order By ClassOrder Asc,ClassID Asc"
	Call Exe_Conn(rs,sql,1)
	i = 1
	Do while not Rs.eof
		If i = 1 Then
			Response.Write "{id:"&rs("ClassID")&",pId:"&rs("ClassParent")&",name:"""&rs("ClassName")&""""
			If rs("ClassID") = ClassID Then
				Response.Write ",checked:true,chkDisabled:true"
			End If
			Response.Write ",open:true}"
		Else
			Response.Write ",{id:"&rs("ClassID")&",pId:"&rs("ClassParent")&",name:"""&rs("ClassName")&""""
			If rs("ClassID") = ClassID Then
				Response.Write ",checked:true,chkDisabled:true"
			End If
			Response.Write ",open:true}"
		End If
		Rs.MoveNext
		i=i+1
	Loop
	Set Rs=Nothing
	Response.Write "];" & vbCrLf
	Response.Write "function onCheck(e,treeId,treeNode){$(""#go"").attr(""value"",treeNode.id);}" & vbCrLf
	Response.Write "$(function(){$.fn.zTree.init($(""#ztree""),setting,zNodes);})" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "</head>" & vbCrLf
	Response.Write "<body>" & vbCrLf
	Response.Write "<dl>" & vbCrLf
	Response.Write "    <dt><b>目标栏目：</b><input type=""hidden"" name=""go"" id=""go"" value=""" & ClassID & """><ul id=""ztree"" class=""ztree""></ul></dt>" & vbCrLf
	Response.Write "</dl>" & vbCrLf
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub Move()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		ID = Trim(Code_Form("ID"))
		Csid = Trim(Code_Form("ClassID"))
		go = Trim(Code_Form("go"))
		dim idarr:idarr=split(ID,",")
		if ubound(idarr)<0 then
			Response.Write "{""code"":0,""msg"":""&#33267;&#23569;&#36873;&#25321;&#19968;&#26465;&#20449;&#24687;""}"
		else
			sqlDel = "Select UploadFiles,PaginationType,MaxCharPerPage,ClassID,HtmlFileDate,ID,Content From " & Data_Name & " Where ID in (" & ID & ")"
			Call Exec(rsDel,sqlDel,2)
			Do While Not rsDel.EOF
				If ChannelIsCreateHtml = True Then
					Select Case rsDel("PaginationType")
						Case 0    '不分页显示
							Set Cfs=New Cls_FileSystem
							Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
							Set Cfs=Nothing
						Case 1    '自动分页显示
							ContentLen = Len(Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1)))
							totalPage = ContentLen \ rsDel("MaxCharPerPage")
							If rsDel("MaxCharPerPage") * totalPage < ContentLen Then
								totalPage = totalPage + 1
							End If
							For j = 1 To totalPage
								If j=1 Then
									Set Cfs=New Cls_FileSystem
									Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
									Set Cfs=Nothing
								Else
									Set Cfs=New Cls_FileSystem
									Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, j))
									Set Cfs=Nothing
								End If
							Next
						Case 2    '手动分页显示
							u = 1
							strTempContent = Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1))
							strTemp = ""
							HasPageTitle = False
							regEx.MultiLine = False
							regEx.Pattern = "\[NextPage(.*?)\]"
							Set Matches = regEx.Execute(strTempContent)
							For Each Match In Matches
								If u = 1 Then
									If Match.SubMatches(0) <> "" Then
										If nohtml(Left(strTempContent, InStr(strTempContent, Match.SubMatches(0)))) <> "" Then
											strTempContent = Code_Replace(strTempContent, Match.Value, "") '去掉第一个匹配的[NextPage 分页标题]
											strTemp = "第 1 页：" & Trim(Match.SubMatches(0))
										Else
											strTemp = "第 1 页：$$$第 2 页：" & Trim(Match.SubMatches(0))
										u = u + 1
										End If
										HasPageTitle = True
									Else
										strTemp = "第 1 页：$$$第 2 页："
										u = u + 1
									End If
								Else
									If Match.SubMatches(0) <> "" Then
										strTemp = strTemp & "$$$第 " & u & " 页：" & Trim(Match.SubMatches(0))
										HasPageTitle = True
									Else
										strTemp = strTemp & "$$$第 " & u & " 页："
									End If
								End If
								u = u + 1
							Next
							regEx.MultiLine = True
							strTempContent = regEx.Replace(strTempContent, "[NextPage]")  '将[NextPage 分页标题]替换成[NextPage]
							If HasPageTitle = True Then
								strContentPageTitleArr = strTemp
							Else
								strContentPageTitleArr = ""
							End If
							If InStr(strTempContent, "[NextPage]") <= 0 Then
								Response.End()
							End If
							arrContent = Split(strTempContent, "[NextPage]")
							totalPage = UBound(arrContent) + 1
							If CurrentPage < 1 Then CurrentPage = 1
							If CurrentPage > totalPage Then CurrentPage = totalPage
							For u = 1 To totalPage
								If u=1 Then
									Set Cfs=New Cls_FileSystem
									Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
									Set Cfs=Nothing
								Else
									Set Cfs=New Cls_FileSystem
									Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, u))
									Set Cfs=Nothing
								End If
							Next
					End Select
				End If
				rsDel.MoveNext
			Loop
			rsDel.Close
			Set rsDel = Nothing
			dim i
			for i=0 to ubound(idarr)
				if not isnumeric(idarr(i)) then
					Response.Write "{""code"":0,""msg"":""&#21442;&#25968;&#65306;"&idarr(i)&"&#19981;&#27491;&#30830;&#65292;&#35831;&#30830;&#35748;&#21518;&#20877;&#25805;&#20316;""}"
					exit sub
				end if
			next
			dbupdate Data_Name,"ID in("&ID&") and ClassID="&Csid&"",array(array("ClassID",go,0,0))
			Response.Write "{""code"":1,""msg"":""\u79fb\u52a8\u6210\u529f"",""ClassID"":"""&Csid&","&go&""",""id"":"""&ID&"""}"
		end if
		Response.End()
	End If
End Sub

Sub ReOrder()
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" href=""../Style/global.css"" media=""all"">" & vbCrLf
	Response.Write "<link rel=""stylesheet"" href=""../Style/font.css"" media=""all"">" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "</head>" & vbCrlf
	Response.Write "<body>" & vbCrlf
	Dim rsClass,cRs,i
	Call Exec(rsClass,"Select * From Class Where ChannelID=" & ChannelID,2)
	Do While Not rsClass.EOF
		Call Exec(cRs,"Select * From " & Data_Name & " Where ChannelID=" & ChannelID & " And IsDelete=" & WK_False & " And ClassID=" & rsClass("ClassID") & " order by ID asc",2)
		i=1
		Do While Not cRs.EOF
			Call Exec("","Update " & Data_Name & " Set OrderID=" & i & " Where ChannelID=" & ChannelID & " And ClassID=" & rsClass("ClassID") & " And ID=" & cRs("ID"),0)
		cRs.movenext
		i=i+1
		Loop
		cRs.Close:Set cRs = Nothing
	rsClass.movenext
	Loop
	rsClass.Close:Set rsClass = Nothing
	Response.Write IsSuccess("成功重新排序！",AdminFolder & "/" & ChannelDir & "/" & strFileName & "?Action=Listing&ChannelID=" & ChannelID & "")
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub SetProperty()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsProperty,sqlProperty,Csid
		ID = Trim(Code_Form("ID"))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u5148\u9009\u5b9a" & ChannelTit & "\uff01""}"
			Response.End()
		End If
		If InStr(ID, ",") > 0 Then
			sqlProperty = "select * From " & Data_Name & " where ID in (" & ID & ")"
		Else
			sqlProperty = "select * From " & Data_Name & " where ID=" & ID
		End If
		Call Exe_Conn(rsProperty,sqlProperty,3)
		Do While Not rsProperty.EOF
			If Csid = "" Then
				Csid = rsProperty("ClassID")
			Else
				Csid = Csid & "," & rsProperty("ClassID")
			End If
			Select Case Action
			Case "SetePassed"
				rsProperty("Hidden") = WK_True
			Case "CancelPassed"
				rsProperty("Hidden") = WK_False
			End Select
			rsProperty.Update
			rsProperty.MoveNext
		Loop
		rsProperty.Close
		Set rsProperty = Nothing
		Select Case Action
		Case "SetePassed"
			Response.Write "{""code"":1,""msg"":""\u6210\u529f\u5ba1\u6838"&ChannelTit&"\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		Case "CancelPassed"
			Response.Write "{""code"":1,""msg"":""\u6210\u529f\u53d6\u6d88\u5ba1\u6838"&ChannelTit&"\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		End Select
		Response.End()
	End If
End Sub

Sub Del()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsDel,sqlDel,Csid
		ID = Trim(Code_Form("ID"))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u5148\u9009\u5b9a" & ChannelTit & "\uff01""}"
			Response.End()
		End If
		If InStr(ID, ",") > 0 Then
			sqlDel = "select * From " & Data_Name & " where ID in (" & ID & ")"
		Else
			sqlDel = "select * From " & Data_Name & " where ID=" & ID
		End If
		Call Exe_Conn(rsDel,sqlDel,3)
		Do While Not rsDel.EOF
			If Csid = "" Then
				Csid = rsDel("ClassID")
			Else
				Csid = Csid & "," & rsDel("ClassID")
			End If
			rsDel("IsDelete") = WK_True
			rsDel.Update
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		Response.Write "{""code"":1,""msg"":""\u6210\u529f\u5220\u9664"&ChannelTit&"\uff01\u60a8\u53ef\u4ee5\u5728"&ChannelTit&"\u56de\u6536\u7ad9\u6062\u590d\u5b83\u4eec\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		Response.End()
	End If
End Sub

Sub ConfirmDel()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsDel,sqlDel,Csid,StrDownloadUrl,ContentLen,j,u,strTempContent,strTemp,HasPageTitle,Matches,Match,strContentPageTitleArr,arrContent,Cfs
		ID = Trim(Code_Form("ID"))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u5148\u9009\u5b9a" & ChannelTit & "\uff01""}"
			Response.End()
		End If
		sqlDel = "Select UploadFiles,PaginationType,MaxCharPerPage,ClassID,HtmlFileDate,ID,Content From " & Data_Name & " Where ID in (" & ID & ")"
		Call Exec(rsDel,sqlDel,2)
		Do While Not rsDel.EOF
			If Csid = "" Then
				Csid = rsDel("ClassID")
			Else
				Csid = Csid & "," & rsDel("ClassID")
			End If
			If rsDel("UploadFiles")<>"" Then
				StrDownloadUrl=Trim(Replace(rsDel("UploadFiles"),"{$download_dir}",InstallDir&UploadSetting(1)))
				If Instr(StrDownloadUrl,"@@@") >0 Then
					StrDownloadUrl=Split(StrDownloadUrl,"@@@")
					For i=0 to Ubound(StrDownloadUrl)
						Set Cfs=New Cls_FileSystem
						If Cfs.Chk_Exist(StrDownloadUrl(i),1) Then Cfs.Del_File(StrDownloadUrl(i))
						Set Cfs=Nothing
					Next
				Else
					Set Cfs=New Cls_FileSystem
					If Cfs.Chk_Exist(StrDownloadUrl,1) Then Cfs.Del_File(StrDownloadUrl)
					Set Cfs=Nothing
				End If
			End If
			If ChannelIsCreateHtml = True Then
				Select Case rsDel("PaginationType")
					Case 0    '不分页显示
						Set Cfs=New Cls_FileSystem
						Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
						Set Cfs=Nothing
					Case 1    '自动分页显示
						ContentLen = Len(Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1)))
						totalPage = ContentLen \ rsDel("MaxCharPerPage")
						If rsDel("MaxCharPerPage") * totalPage < ContentLen Then
							totalPage = totalPage + 1
						End If
						For j = 1 To totalPage
							If j=1 Then
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
								Set Cfs=Nothing
							Else
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, j))
								Set Cfs=Nothing
							End If
						Next
					Case 2    '手动分页显示
						u = 1
						strTempContent = Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1))
						strTemp = ""
						HasPageTitle = False
						regEx.MultiLine = False
						regEx.Pattern = "\[NextPage(.*?)\]"
						Set Matches = regEx.Execute(strTempContent)
						For Each Match In Matches
							If u = 1 Then
								If Match.SubMatches(0) <> "" Then
									If nohtml(Left(strTempContent, InStr(strTempContent, Match.SubMatches(0)))) <> "" Then
										strTempContent = Code_Replace(strTempContent, Match.Value, "") '去掉第一个匹配的[NextPage 分页标题]
										strTemp = "第 1 页：" & Trim(Match.SubMatches(0))
									Else
										strTemp = "第 1 页：$$$第 2 页：" & Trim(Match.SubMatches(0))
									u = u + 1
									End If
									HasPageTitle = True
								Else
									strTemp = "第 1 页：$$$第 2 页："
									u = u + 1
								End If
							Else
								If Match.SubMatches(0) <> "" Then
									strTemp = strTemp & "$$$第 " & u & " 页：" & Trim(Match.SubMatches(0))
									HasPageTitle = True
								Else
									strTemp = strTemp & "$$$第 " & u & " 页："
								End If
							End If
							u = u + 1
						Next
						regEx.MultiLine = True
						strTempContent = regEx.Replace(strTempContent, "[NextPage]")  '将[NextPage 分页标题]替换成[NextPage]
						If HasPageTitle = True Then
							strContentPageTitleArr = strTemp
						Else
							strContentPageTitleArr = ""
						End If
						If InStr(strTempContent, "[NextPage]") <= 0 Then
							Response.End()
						End If
						arrContent = Split(strTempContent, "[NextPage]")
						totalPage = UBound(arrContent) + 1
						If CurrentPage < 1 Then CurrentPage = 1
						If CurrentPage > totalPage Then CurrentPage = totalPage
						For u = 1 To totalPage
							If u=1 Then
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
								Set Cfs=Nothing
							Else
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, u))
								Set Cfs=Nothing
							End If
						Next
				End Select
			End If
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		Call Exec("","Delete From " & Data_Name & " Where ID in (" & ID & ")",0)
		Response.Write "{""code"":1,""msg"":""\u6210\u529f\u5220\u9664"&ChannelTit&"\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		Response.End()
	End If
End Sub

Sub ClearRecycleBin()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsDel,sqlDel,Csid,StrDownloadUrl,ContentLen,j,u,strTempContent,strTemp,HasPageTitle,Matches,Match,strContentPageTitleArr,arrContent,Cfs
		ChannelID = Code_CLng(Trim(Code_Form("ChannelID")))
		If ChannelID = "" Then
			Response.Write "{""code"":0,""msg"":""\u9891\u9053ID\u4e3a\u7a7a""}"
			Response.End()
		End If
		sqlDel = "select ID,UploadFiles,PaginationType,MaxCharPerPage,ClassID,HtmlFileDate,Content From " & Data_Name & " where IsDelete=" & WK_True & " And ChannelID=" & ChannelID
		Call Exec(rsDel,sqlDel,2)
		Do While Not rsDel.EOF
			If ID = "" Then
				ID = rsDel(0)
			Else
				ID = ID & "," & rsDel(0)
			End If
			If Csid = "" Then
				Csid = rsDel(4)
			Else
				Csid = Csid & "," & rsDel(4)
			End If
			If rsDel("UploadFiles")<>"" Then
				StrDownloadUrl=Trim(Replace(rsDel("UploadFiles"),"{$download_dir}",InstallDir&UploadSetting(1)))
				If Instr(StrDownloadUrl,"@@@") >0 Then
					StrDownloadUrl=Split(StrDownloadUrl,"@@@")
					For i=0 to Ubound(StrDownloadUrl)
						Set Cfs=New Cls_FileSystem
						If Cfs.Chk_Exist(StrDownloadUrl(i),1) Then Cfs.Del_File(StrDownloadUrl(i))
						Set Cfs=Nothing
					Next
				Else
					Set Cfs=New Cls_FileSystem
					If Cfs.Chk_Exist(StrDownloadUrl,1) Then Cfs.Del_File(StrDownloadUrl)
					Set Cfs=Nothing
				End If
			End If
			If ChannelIsCreateHtml = True Then
				Select Case rsDel("PaginationType")
					Case 0    '不分页显示
						Set Cfs=New Cls_FileSystem
						Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
						Set Cfs=Nothing
					Case 1    '自动分页显示
						ContentLen = Len(Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1)))
						totalPage = ContentLen \ rsDel("MaxCharPerPage")
						If rsDel("MaxCharPerPage") * totalPage < ContentLen Then
							totalPage = totalPage + 1
						End If
						For j = 1 To totalPage
							If j=1 Then
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
								Set Cfs=Nothing
							Else
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, j))
								Set Cfs=Nothing
							End If
						Next
					Case 2    '手动分页显示
						u = 1
						strTempContent = Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1))
						strTemp = ""
						HasPageTitle = False
						regEx.MultiLine = False
						regEx.Pattern = "\[NextPage(.*?)\]"
						Set Matches = regEx.Execute(strTempContent)
						For Each Match In Matches
							If u = 1 Then
								If Match.SubMatches(0) <> "" Then
									If nohtml(Left(strTempContent, InStr(strTempContent, Match.SubMatches(0)))) <> "" Then
										strTempContent = Code_Replace(strTempContent, Match.Value, "") '去掉第一个匹配的[NextPage 分页标题]
										strTemp = "第 1 页：" & Trim(Match.SubMatches(0))
									Else
										strTemp = "第 1 页：$$$第 2 页：" & Trim(Match.SubMatches(0))
									u = u + 1
									End If
									HasPageTitle = True
								Else
									strTemp = "第 1 页：$$$第 2 页："
									u = u + 1
								End If
							Else
								If Match.SubMatches(0) <> "" Then
									strTemp = strTemp & "$$$第 " & u & " 页：" & Trim(Match.SubMatches(0))
									HasPageTitle = True
								Else
									strTemp = strTemp & "$$$第 " & u & " 页："
								End If
							End If
							u = u + 1
						Next
						regEx.MultiLine = True
						strTempContent = regEx.Replace(strTempContent, "[NextPage]")  '将[NextPage 分页标题]替换成[NextPage]
						If HasPageTitle = True Then
							strContentPageTitleArr = strTemp
						Else
							strContentPageTitleArr = ""
						End If
						If InStr(strTempContent, "[NextPage]") <= 0 Then
							Response.End()
						End If
						arrContent = Split(strTempContent, "[NextPage]")
						totalPage = UBound(arrContent) + 1
						If CurrentPage < 1 Then CurrentPage = 1
						If CurrentPage > totalPage Then CurrentPage = totalPage
						For u = 1 To totalPage
							If u=1 Then
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
								Set Cfs=Nothing
							Else
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, u))
								Set Cfs=Nothing
							End If
						Next
				End Select
			End If
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		If ID <> "" Then
			Call Exec("","Delete From " & Data_Name & " Where IsDelete=" & WK_True & " And ChannelID=" & ChannelID,0)
		End If
		Response.Write "{""code"":1,""msg"":""\u6210\u529f\u5220\u9664"&ChannelTit&"\u56de\u6536\u7ad9\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		Response.End()
	End If
End Sub

Sub DelFile()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsDel,sqlDel,Csid,ContentLen,j,u,strTempContent,strTemp,HasPageTitle,Matches,Match,strContentPageTitleArr,arrContent,Cfs
		ID = Trim(Code_Form("ID"))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u5148\u9009\u5b9a" & ChannelTit & "\uff01""}"
			Response.End()
		End If
		sqlDel = "Select UploadFiles,PaginationType,MaxCharPerPage,ClassID,HtmlFileDate,ID,Content From " & Data_Name & " Where ID in (" & ID & ")"
		Call Exec(rsDel,sqlDel,2)
		Do While Not rsDel.EOF
			If ChannelIsCreateHtml = True Then
				Select Case rsDel("PaginationType")
					Case 0    '不分页显示
						Set Cfs=New Cls_FileSystem
						Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
						Set Cfs=Nothing
					Case 1    '自动分页显示
						ContentLen = Len(Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1)))
						totalPage = ContentLen \ rsDel("MaxCharPerPage")
						If rsDel("MaxCharPerPage") * totalPage < ContentLen Then
							totalPage = totalPage + 1
						End If
						For j = 1 To totalPage
							If j=1 Then
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
								Set Cfs=Nothing
							Else
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, j))
								Set Cfs=Nothing
							End If
						Next
					Case 2    '手动分页显示
						u = 1
						strTempContent = Replace(rsDel("Content"),"{$download_dir}",InstallDir & UploadSetting(1))
						strTemp = ""
						HasPageTitle = False
						regEx.MultiLine = False
						regEx.Pattern = "\[NextPage(.*?)\]"
						Set Matches = regEx.Execute(strTempContent)
						For Each Match In Matches
							If u = 1 Then
								If Match.SubMatches(0) <> "" Then
									If nohtml(Left(strTempContent, InStr(strTempContent, Match.SubMatches(0)))) <> "" Then
										strTempContent = Code_Replace(strTempContent, Match.Value, "") '去掉第一个匹配的[NextPage 分页标题]
										strTemp = "第 1 页：" & Trim(Match.SubMatches(0))
									Else
										strTemp = "第 1 页：$$$第 2 页：" & Trim(Match.SubMatches(0))
									u = u + 1
									End If
									HasPageTitle = True
								Else
									strTemp = "第 1 页：$$$第 2 页："
									u = u + 1
								End If
							Else
								If Match.SubMatches(0) <> "" Then
									strTemp = strTemp & "$$$第 " & u & " 页：" & Trim(Match.SubMatches(0))
									HasPageTitle = True
								Else
									strTemp = strTemp & "$$$第 " & u & " 页："
								End If
							End If
							u = u + 1
						Next
						regEx.MultiLine = True
						strTempContent = regEx.Replace(strTempContent, "[NextPage]")  '将[NextPage 分页标题]替换成[NextPage]
						If HasPageTitle = True Then
							strContentPageTitleArr = strTemp
						Else
							strContentPageTitleArr = ""
						End If
						If InStr(strTempContent, "[NextPage]") <= 0 Then
							Response.End()
						End If
						arrContent = Split(strTempContent, "[NextPage]")
						totalPage = UBound(arrContent) + 1
						If CurrentPage < 1 Then CurrentPage = 1
						If CurrentPage > totalPage Then CurrentPage = totalPage
						For u = 1 To totalPage
							If u=1 Then
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, ""))
								Set Cfs=Nothing
							Else
								Set Cfs=New Cls_FileSystem
								Cfs.Del_File(InstallDir & ChannelDir & "/" & Class_Path_Get(rsDel("ClassID")) & ShowDatePath(rsDel("HtmlFileDate"), ChannelHtmlPath) & ReadFileName(rsDel("HtmlFileDate"), rsDel("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, u))
								Set Cfs=Nothing
							End If
						Next
				End Select
			End If
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		Response.Write "{""code"":1,""msg"":""\u6210\u529f\u5220\u9664"&ChannelTit&"\u7684HTML\u9875\u9762\uff01""}"
		Response.End()
	End If
End Sub

Sub BatchReplace()
	Dim ID
	Response.Write "<!DOCTYPE html>" & vbCrLf
	Response.Write "<head>" & vbCrLf
	Response.Write "<title>" & ChannelTit & "管理</title>" & vbCrlf
	Response.Write "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>" & vbCrLf
	Response.Write "<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-status-bar-style' content='black'>" & vbCrLf
	Response.Write "<meta name='apple-mobile-web-app-capable' content='yes'>" & vbCrLf
	Response.Write "<meta name='format-detection' content='telephone=no'>" & vbCrLf
	Response.Write "<link rel=""stylesheet"" type=""text/css"" href=""../fonts/font-awesome/css/font-awesome.min.css"" />" & vbCrLf
	Response.Write "<link href='../Plugins/layui/css/layui.css' rel='stylesheet' type='text/css' />" & vbCrLf
	Response.Write "<link rel=""stylesheet"" href=""../Style/global.css"" media=""all"">" & vbCrLf
	Response.Write "<link rel=""stylesheet"" href=""../Style/font.css"" media=""all"">" & vbCrLf
	Response.Write "<script type='text/javascript'>" & vbCrLf
	Response.Write "var pc_file = '" & InstallDir & "';" & vbCrLf
	Response.Write "var admin_file = '" & AdminFolder & "/';" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../Js/Admin.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/main.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcore.min.js'></script>" & vbCrLf
	Response.Write "<script type='text/javascript' src='../../Dialog/lhgcalendar.min.js'></script>" & vbCrLf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/layui/layui.js""></script>" & vbCrlf
	Response.Write "<script type=""text/javascript"" src=""../Plugins/xm-select/xm-select.js""></script>" & vbCrlf
	Response.Write "</head>" & vbCrlf
	Response.Write "<body>" & vbCrlf
	ID = Replace(Trim(Request("ID")), " ", "")
	Response.Write "<form class='layui-form layui-form-pane' method='post' name='myform' action='?Action=DoBatchReplace'>"
	Response.Write "<div class=""admin-main layui-anim layui-anim-upbit"">" & vbCrlf
	Response.Write "    <fieldset class=""layui-elem-field layui-field-title"">" & vbCrlf
	Response.Write "        <legend>批量替换" & ChannelTit & "内容</legend>" & vbCrlf
	Response.Write "    </fieldset>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">" & ChannelTit & "范围：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-inline"">" & vbCrlf
	Response.Write "            <input type='radio' name='BatchType' value='1' title=""指定" & ChannelTit & "ID"" checked>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='text' name='BatchID' value='" & ID & "' size='28' lay-verify=""BatchID"" class=""layui-input"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label""></label>" & vbCrlf
	Response.Write "        <div class=""layui-input-inline"">" & vbCrlf
	Response.Write "            <input type='radio' name='BatchType' value='2' title=""指定栏目的" & ChannelTit & """>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <div id=""BatchClassID"" class=""xm-select-demo""></div>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">替换内容：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='checkbox' name='ItemBatchTitle'  value='yes' title=""" & ChannelTit & "标题"">"
	Response.Write "            <input type='checkbox' name='ItemBatchContent'  value='yes' title=""" & ChannelTit & "内容"" checked>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">替换类型：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='radio' name='ItemBatchType' lay-filter='ItemBatchType' onClick=""javascript:WK_ItemReplaceStart.style.display='none';WK_ItemReplaceEnd.style.display='none';WK_ItemReplace.style.display='';"" value='1' title=""简单替换"" checked>"
	Response.Write "            <input type='radio' name='ItemBatchType' lay-filter='ItemBatchType' onClick=""javascript:WK_ItemReplaceStart.style.display='';WK_ItemReplaceEnd.style.display='';WK_ItemReplace.style.display='none';"" value='2' title=""高级替换"">" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item layui-form-text"" id='WK_ItemReplace' style='display:'>" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">要替换的字符：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-block"">" & vbCrlf
	Response.Write "            <textarea name='ItemReplace' id='ItemReplace' cols='60' rows='5' lay-verify=""ItemReplace"" class=""layui-textarea""></textarea>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item layui-form-text"" id='WK_ItemReplaceStart' style='display:none'>" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">要替换的开始字符：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-block"">" & vbCrlf
	Response.Write "            <textarea name='ItemReplaceStart' id='ItemReplaceStart' cols='60' rows='5' lay-verify=""ItemReplaceStart"" class=""layui-textarea""></textarea>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item layui-form-text"" id='WK_ItemReplaceEnd' style='display:none'>" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">要替换的结束字符：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-block"">" & vbCrlf
	Response.Write "            <textarea name='ItemReplaceEnd' id='ItemReplaceEnd' cols='60' rows='5' lay-verify=""ItemReplaceEnd"" class=""layui-textarea""></textarea>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item layui-form-text"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">要替换后的字符：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-block"">" & vbCrlf
	Response.Write "            <textarea name='ItemReplaceResult' id='ItemReplaceResult' cols='60' rows='5' lay-verify=""ItemReplaceResult"" class=""layui-textarea""></textarea>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">标题加前缀</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='radio' name='IsTitlePrefix' lay-filter='IsTitlePrefix' onClick=""javascript:WK_TitlePrefix.style.display='';"" value='1' title=""是"">"
	Response.Write "            <input type='radio' name='IsTitlePrefix' lay-filter='IsTitlePrefix' onClick=""javascript:WK_TitlePrefix.style.display='none';"" value='0' title=""否"" checked>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item layui-form-text"" id='WK_TitlePrefix' style='display:none'>" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">给标题前缀字符：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-block"">" & vbCrlf
	Response.Write "            <textarea name='ItemTitlePrefix' id='ItemTitlePrefix' cols='60' rows='5' lay-verify=""ItemTitlePrefix"" class=""layui-textarea""></textarea>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item"">" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">内容加前缀</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-4"">" & vbCrlf
	Response.Write "            <input type='radio' name='IsContentPrefix' lay-filter='IsContentPrefix' onClick=""javascript:WK_ContentPrefix.style.display='';"" value='1' title=""是"">"
	Response.Write "            <input type='radio' name='IsContentPrefix' lay-filter='IsContentPrefix' onClick=""javascript:WK_ContentPrefix.style.display='none';"" value='0' title=""否"" checked>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "    <div class=""layui-form-item layui-form-text"" id='WK_ContentPrefix' style='display:none'>" & vbCrlf
	Response.Write "        <label class=""layui-form-label"">给内容加前缀字符：</label>" & vbCrlf
	Response.Write "        <div class=""layui-input-block"">" & vbCrlf
	Response.Write "            <textarea name='ItemContentPrefix' id='ItemContentPrefix' cols='60' rows='5' lay-verify=""ItemContentPrefix"" class=""layui-textarea""></textarea>" & vbCrlf
	Response.Write "        </div>" & vbCrlf
	Response.Write "    </div>" & vbCrlf
	Response.Write "</div>" & vbCrLf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<br>" & vbCrlf
	Response.Write "<input name=""ChannelID"" type=""hidden"" id=""ChannelID"" value=""" & ChannelID & """>" & Submit_Layui("开始替换","重新填写","确认要清空对话框内容？","javascript:history.back();","返回上一页","") & vbCrlf
	Response.Write "</form>" & vbCrLf
	Response.Write "<script>" & vbCrLf
	Response.Write "layui.use(['form','element'], function () {" & vbCrLf
	Response.Write "    var form = layui.form,element = layui.element;" & vbCrLf
	Response.Write "    //自定义表单验证" & vbCrLf
	Response.Write "    form.verify({" & vbCrLf
	Response.Write "        BatchID: function (value, item) {" & vbCrLf
	Response.Write "            if (!value && $('input[name=""BatchType""]:checked ').val()==1){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""指定" & ChannelTit & "ID不能为空！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "            if (isNaN(Number(value)) && $('input[name=""BatchType""]:checked ').val()==1){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""指定" & ChannelTit & "ID不是数字！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        BatchClassID: function (value, item) {" & vbCrLf
	Response.Write "            if (!value && $('input[name=""BatchType""]:checked ').val()==2){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""指定栏目的" & ChannelTit & "不能为空！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        ItemReplace: function (value, item) {" & vbCrLf
	Response.Write "            if (!value && $('input[name=""ItemBatchType""]:checked ').val()==1){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""要替换的字符不能为空！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        ItemReplaceResult: function (value, item) {" & vbCrLf
	Response.Write "            if (!value){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""要替换后的字符不能为空！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        ItemReplaceStart: function (value, item) {" & vbCrLf
	Response.Write "            if (!value && $('input[name=""ItemBatchType""]:checked ').val()==2){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""要替换的开始字符不能为空！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        ItemReplaceEnd: function (value, item) {" & vbCrLf
	Response.Write "            if (!value && $('input[name=""ItemBatchType""]:checked ').val()==2){" & vbCrLf
	Response.Write "                item.focus();" & vbCrLf
	Response.Write "                return ""要替换的结束字符不能为空！"";" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "    });" & vbCrLf
	Response.Write "    var BatchClassID = xmSelect.render({" & vbCrLf
	Response.Write "        el: '#BatchClassID'," & vbCrLf
	Response.Write "        name: 'BatchClassID'," & vbCrLf
	Response.Write "        layVerify: 'BatchClassID'," & vbCrLf
	'Response.Write "        radio: true," & vbCrLf
	'Response.Write "        clickClose: true," & vbCrLf
	'Response.Write "        tips: '指定栏目的" & ChannelTit & "?'," & vbCrLf
	'Response.Write "        empty: '呀, 没有数据呢'," & vbCrLf
	Response.Write "        autoRow: true," & vbCrLf
	Response.Write "        filterable: true," & vbCrLf
	Response.Write "        height: '300px'," & vbCrLf
	Response.Write "        direction: 'down'," & vbCrLf
	Response.Write "        tree: {" & vbCrLf
	Response.Write "            show: true,//是否显示树状结构" & vbCrLf
	Response.Write "            showFolderIcon: true,//是否展示三角图标" & vbCrLf
	Response.Write "            showLine: true,//是否显示虚线" & vbCrLf
	Response.Write "            indent: 20,//间距" & vbCrLf
	Response.Write "            expandedKeys: true,//默认展开节点的数组, 为 true 时, 展开所有节点" & vbCrLf
	Response.Write "            strict: false,//是否严格遵守父子模式" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        toolbar: {" & vbCrLf
	Response.Write "            show: true," & vbCrLf
	Response.Write "            list: ['ALL', 'REVERSE', 'CLEAR']" & vbCrLf
	Response.Write "        }," & vbCrLf
	Response.Write "        data: [" & vbCrLf
	Response.Write GetClass_Option(ChannelID, 0, ClassID)
	Response.Write "        ]" & vbCrLf
	Response.Write "    })" & vbCrLf
	Response.Write "    //监听ItemBatchType" & vbCrLf
	Response.Write "    form.on('radio(ItemBatchType)', function(data){" & vbCrlf
	Response.Write "        if(data.value==1){" & vbCrlf
	Response.Write "            WK_ItemReplaceStart.style.display='none';WK_ItemReplaceEnd.style.display='none';WK_ItemReplace.style.display='';" & vbCrlf
	Response.Write "        }else{" & vbCrlf
	Response.Write "            WK_ItemReplaceStart.style.display='';WK_ItemReplaceEnd.style.display='';WK_ItemReplace.style.display='none';" & vbCrlf
	Response.Write "        }" & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //监听IsTitlePrefix" & vbCrLf
	Response.Write "    form.on('radio(IsTitlePrefix)', function(data){" & vbCrlf
	Response.Write "        if(data.value==0){" & vbCrlf
	Response.Write "            WK_TitlePrefix.style.display='none';" & vbCrlf
	Response.Write "        }else{" & vbCrlf
	Response.Write "            WK_TitlePrefix.style.display='';" & vbCrlf
	Response.Write "        }" & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //监听IsContentPrefix" & vbCrLf
	Response.Write "    form.on('radio(IsContentPrefix)', function(data){" & vbCrlf
	Response.Write "        if(data.value==0){" & vbCrlf
	Response.Write "            WK_ContentPrefix.style.display='none';" & vbCrlf
	Response.Write "        }else{" & vbCrlf
	Response.Write "            WK_ContentPrefix.style.display='';" & vbCrlf
	Response.Write "        }" & vbCrlf
	Response.Write "    });" & vbCrlf
	Response.Write "    //提交监听" & vbCrLf
	Response.Write "    form.on('submit(submit)', function (data) {" & vbCrLf
	Response.Write "        loading=layer.load(1, {shade: [0.1,'#fff']});" & vbCrLf
	Response.Write "        $.ajax({" & vbCrLf
	Response.Write "            type: 'post'," & vbCrLf
	Response.Write "            url: '?Action=DoBatchReplace'," & vbCrLf
	Response.Write "            data: data.field," & vbCrLf
	Response.Write "            dataType: 'json'," & vbCrLf
	Response.Write "            success: function(res) {" & vbCrLf
	Response.Write "                layer.close(loading);" & vbCrLf
	Response.Write "                if(res.code > 0){" & vbCrLf
	Response.Write "                    layer.alert(res.msg,{icon: 1},function(){" & vbCrLf
	Response.Write "                        location.href = res.url;" & vbCrLf
	Response.Write "                    });" & vbCrLf
	Response.Write "                }else{" & vbCrLf
	Response.Write "                    layer.msg(res.msg,{icon: 2, time: 1000});" & vbCrLf
	Response.Write "                }" & vbCrLf
	Response.Write "            }" & vbCrLf
	Response.Write "        });" & vbCrLf
	Response.Write "    });" & vbCrLf
	Response.Write "});" & vbCrLf
	Response.Write "</script>" & vbCrLf
	Response.Write "</body>" & vbCrLf & "</html>"
End Sub

Sub DoBatchReplace()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim rs, sql, BatchType, BatchID, BatchClassID
		Dim ItemBatchType, ItemReplace, ItemReplaceStart, ItemReplaceEnd, ItemReplaceResult
		Dim ItemBatchTitle, ItemBatchContent, IsTitlePrefix, ItemTitlePrefix, IsContentPrefix, ItemContentPrefix
		Dim FoundErr, ErrMsg, SuccessMsg
		
		BatchType = Code_CLng(Trim(Request("BatchType")))
		BatchID = Trim(Code_Form("BatchID"))
		BatchClassID = FilterArrNull(Trim(Code_Form("BatchClassID")), ",")
		ChannelID = Code_CLng(Trim(Code_Form("ChannelID")))
		
		ItemBatchType = Code_CLng(Trim(Code_Form("ItemBatchType")))
		ItemBatchTitle = Trim(Code_Form("ItemBatchTitle"))
		ItemBatchContent = Trim(Code_Form("ItemBatchContent"))
		ItemReplace = Trim(Code_Form("ItemReplace"))
		ItemReplaceStart = Trim(Code_Form("ItemReplaceStart"))
		ItemReplaceEnd = Trim(Code_Form("ItemReplaceEnd"))
		ItemReplaceResult = Trim(Code_Form("ItemReplaceResult"))
		
		IsTitlePrefix = Code_CLng(Trim(Code_Form("IsTitlePrefix")))
		ItemTitlePrefix = Trim(Code_Form("ItemTitlePrefix"))
		IsContentPrefix = Code_CLng(Trim(Code_Form("IsContentPrefix")))
		ItemContentPrefix = Trim(Code_Form("ItemContentPrefix"))
		
		If IsTitlePrefix = 0 Then
			ItemTitlePrefix = ""
		Else
			If Len(ItemTitlePrefix) > 100 Then
				Response.Write "{""code"":0,""msg"":""\u6807\u9898\u524d\u7f00\uff0c\u4e0d\u80fd\u8fc7\u957f\uff01""}"
				Response.End()
			End If
		End If
		
		If IsContentPrefix = 0 Then
			ItemContentPrefix = ""
		End If
		
		If BatchType = 1 Then
			If IsValidID(BatchID) = False Then
				Response.Write "{""code"":0,""msg"":""\u8bf7\u6307\u5b9a\u8981\u6279\u91cf\u4fee\u6539\u7684" & ChannelTit & "\u7684ID""}"
				Response.End()
			End If
		Else
			If IsValidID(BatchClassID) = False Then
				Response.Write "{""code"":0,""msg"":""\u8bf7\u6307\u5b9a\u8981\u6279\u91cf\u4fee\u6539\u7684" & ChannelTit & "\u7684\u680f\u76ee\uff01""}"
				Response.End()
			End If
		End If
		
		If ItemBatchTitle = "yes" Then
			ItemBatchTitle = True
		Else
			ItemBatchTitle = False
		End If
		If ItemBatchContent = "yes" Then
			ItemBatchContent = True
		Else
			ItemBatchContent = False
		End If
		
		If ItemBatchTitle = False And ItemBatchContent = False Then
			Response.Write "{""code"":0,""msg"":""\u81f3\u5c11\u8981\u9009\u62e9\u4e00\u4e2a\u8981\u66ff\u6362\u7684\u7c7b\u578b" & ChannelTit & "\u6807\u9898\u6216" & ChannelTit & "\u5185\u5bb9\uff01""}"
			Response.End()
		End If
		
		If ItemBatchType = 0 Then
			Response.Write "{""code"":0,""msg"":""\u6ca1\u6709\u9009\u62e9" & ChannelTit & "\u66ff\u6362\u5b57\u7b26\u7c7b\u578b\uff01""}"
			Response.End()
		End If
		
		If FoundErr = True Then Exit Sub
		
		If ItemBatchType = 1 Then
			If ItemReplace = "" Then
				Response.Write "{""code"":0,""msg"":""\u8f93\u5165\u8981\u66ff\u6362\u7684\u4ee3\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01""}"
				Response.End()
			End If
		ElseIf ItemBatchType = 2 Then
			If ItemReplaceStart = "" Then
				Response.Write "{""code"":0,""msg"":""\u8f93\u5165\u8981\u66ff\u6362\u7684\u5f00\u59cb\u4ee3\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01""}"
				Response.End()
			End If
			If ItemReplaceEnd = "" Then
				Response.Write "{""code"":0,""msg"":""\u8f93\u5165\u8981\u66ff\u6362\u540e\u7684\u7ed3\u675f\u4ee3\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01""}"
				Response.End()
			End If
		Else
			Response.Write "{""code"":0,""msg"":""\u9009\u62e9" & ChannelTit & "\u66ff\u6362\u5b57\u7b26\u7c7b\u578b\u4e0d\u5bf9\uff01""}"
			Response.End()
		End If
		
		If ItemReplaceResult = "" Then
			Response.Write "{""code"":0,""msg"":""\u8f93\u5165\u8981\u66ff\u6362\u540e\u7684\u4ee3\u7801\u4e0d\u80fd\u4e3a\u7a7a\uff01""}"
			Response.End()
		End If
		
		If FoundErr = True Then Exit Sub
		
		If ItemBatchTitle = True Then
			SqlData = "Select count(*) From "&Data_Name&" Where Title='" & ReplaceBadChar(ItemReplaceResult) & "'"
			Call Exec(RsData,SqlData,2)
			If Code_CLng(RsData(0)) > 0 Then
				Response.Write "{""code"":0,""msg"":""\u8981\u66ff\u6362\u7684\u6807\u9898\u4e0e\u6570\u636e\u5e93\u5df2\u6709\u7684\u6807\u9898\u91cd\u590d\uff01""}"
				Response.End()
			End If
		End If

		If BatchType = 1 Then
			sql = "select * from "&Data_Name&" where ChannelID=" & ChannelID & " and ID in (" & BatchID & ")"
		Else
			sql = "select * from "&Data_Name&" where ChannelID=" & ChannelID & " and ClassID in (" & BatchClassID & ")"
		End If
		Call Exe_Conn(rs,sql,3)
		If rs.BOF And rs.EOF Then
			Response.Write "{""code"":0,""msg"":""\u6ca1\u6709\u53ef\u66ff\u6362\u7684\u6807\u9898\u6216\u6b63\u6587\uff01""}"
			Response.End()
		Else
			Do While Not rs.EOF
				If ItemBatchType = 1 Then
					If ItemBatchTitle = True Then
						If InStr(rs("Title"), ItemReplace) <> 0 Then
							rs("Title") = ItemTitlePrefix & Replace(rs("Title"), ItemReplace, ItemReplaceResult)
							SuccessMsg = SuccessMsg & "<br>&nbsp;&nbsp;" & ToUnicode(ChannelTit) & "ID：" & rs("ID") & "&nbsp;&nbsp;" & ToUnicode(rs("Title")) & "..<font color='#009900'>\u6807\u9898\u66ff\u6362\u6210\u529f\uff01</font>"
						End If
					End If
					If ItemBatchContent = True Then
						If InStr(rs("Content"), ItemReplace) <> 0 Then
							rs("Content") = ItemContentPrefix & Replace(rs("Content"), ItemReplace, ItemReplaceResult)
							SuccessMsg = SuccessMsg & "<br>&nbsp;&nbsp;" & ToUnicode(ChannelTit) & "ID：" & rs("ID") & "&nbsp;&nbsp;" & ToUnicode(rs("Title")) & "..<font color='#009900'>\u5185\u5bb9\u66ff\u6362\u6210\u529f\uff01</font>"
						End If
					End If
				ElseIf ItemBatchType = 2 Then
					If ItemBatchTitle = True Then
						rs("Title") = ItemTitlePrefix & BatchReplaceString(ChannelTit, rs("Title"), ItemReplaceStart, ItemReplaceEnd, ItemReplaceResult, "标题", rs("ID"), rs("Title"))
					End If
					If ItemBatchContent = True Then
						rs("Content") = ItemContentPrefix & BatchReplaceString(ChannelTit, rs("Content"), ItemReplaceStart, ItemReplaceEnd, ItemReplaceResult, "内容", rs("ID"), rs("Title"))
					End If
				End If
				rs.Update
				rs.MoveNext
			Loop
		End If
		rs.Close
		Set rs = Nothing
		'Response.Write IsSuccess("" & ChannelTit & "替换操作完成！",AdminFolder & "/" & ChannelDir & "/" & strFileName & "?Action=Listing&ChannelID=" & ChannelID & "")
		Response.Write "{""code"":1,""msg"":""" & ToUnicode(ChannelTit) & "\u66ff\u6362\u64cd\u4f5c\u5b8c\u6210\uff01" & SuccessMsg & """,""url"":""?Action=Listing&ChannelID=" & ChannelID & """}"
		Response.End()
	End If
End Sub

Sub CheckTitle()
	If Trim(Request("Title"))<>"" Then
		Dim rs,sql,SqlClassList,RsClassList,ClassName,ClassUrl,HtmlFileName,HtmlFileUrl
		sql="select * from "&Data_Name&" where ChannelID=" & Trim(Request("ChannelID")) & " and Title='" & Trim(Request("Title")) & "'"
		If Trim(Request("ID"))<>"" Then
			sql=sql&" and ID<>" & Trim(Request("ID")) & ""
		End If
		Call Exe_Conn(rs,sql,3)
		If Not (rs.BOF And rs.EOF) Then
			SqlClassList="select * from Class where ChannelID=" & rs("ChannelID") & " And ClassID=" & rs("ClassID") & " Order By ClassID,ClassOrder,ClassDepth Asc"
			Call Exe_Conn(RsClassList,SqlClassList,1)
			If RsClassList.eof And RsClassList.bof Then
				ClassName=""
			Else
				ClassName = RsClassList("ClassName")
				If ChannelIsCreateHtml = True Then
					ClassUrl = InstallDir & ChannelDir & "/" & RsClassList("HtmlFileDir") & "Index" & ChannelHtmlExtName
				Else
					ClassUrl = InstallDir & ChannelDir & "/List.asp?ClassID=" & RsClassList("ClassID")
				End If
			End If
			If ChannelIsCreateHtml = True Then
				HtmlFileName = ReadFileName(rs("HtmlFileDate"), rs("ID"), ChannelHtmlExtName, ChannelHtmlPrefix, ChannelHtmlForm, "")
				HtmlFileUrl = InstallDir & ChannelDir & "/" & RsClassList("HtmlFileDir") & ShowDatePath(rs("HtmlFileDate"), ChannelHtmlPath) & HtmlFileName
			Else
				HtmlFileUrl = InstallDir & ChannelDir & "/View.asp?id=" & rs("ID")
			End If
			Response.Write "<a href=""" & HtmlFileUrl & """ style=""color:red"" target=""_blank"">&#24050;&#32463;&#23384;&#22312;</a>"
			rs.Close
			Set rs = Nothing
			Exit Sub
		End If
	End If
End Sub

Sub GetKeyWords()
	Session.Codepage = 65001
	Response.Charset = "utf-8"
	If Trim(Request("Title"))<>"" Then
		Response.Write cn_split(UnEscape(lcase(Trim(Request("Title")))),20)
	End If
End Sub

Sub GetKeyWords_BaiDu()
	Session.Codepage = 65001
	Response.Charset = "utf-8"
	If Trim(Request("Title"))<>"" Then
		On Error Resume Next
		Set objXML = server.CreateObject("MSXML2.ServerXMLHTTP")
		objXML.open "GET", "http://zhannei.baidu.com/api/customsearch/keywords?title=" & Server.UrlEncode(Trim(Request("Title"))) & "", False
		objXML.send()
		Dim sc4Json
		Set sc4Json = Server.CreateObject("MSScriptControl.ScriptControl")
		sc4Json.Language = "JavaScript"
		sc4Json.AddCode "var itemTemp=null;function getJSArray(arr, index){itemTemp=arr[index];}"
		sc4Json.AddCode "var jsonObject = " & objXML.responSetext
		Dim File
		Set File = server.CreateObject("Adodb.Stream")
		File.Charset = "UTF-8"
		File.Mode = 3
		File.Open
		File.Type = 2
		File.Position = 0
		File.WriteText sc4Json.Eval("jsonObject['result']['res']['keyword_list']")
		File.Position = 0
		File.Charset = "GB2312"
		'Response.Write File.ReadText
		Response.Write sc4Json.Eval("jsonObject['result']['res']['keyword_list']")
		objXML.Close
		Set objXML = Nothing
		File.Close
		Set File = Nothing
	End If
End Sub

Sub Restore()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsDel,sqlDel,Csid
		ID = Trim(Code_Form("ID"))
		If ID = "" Then
			Response.Write "{""code"":0,""msg"":""\u8bf7\u5148\u9009\u5b9a" & ChannelTit & "\uff01""}"
			Response.End()
		End If
		If InStr(ID, ",") > 0 Then
			sqlDel = "select * From " & Data_Name & " where ID in (" & ID & ")"
		Else
			sqlDel = "select * From " & Data_Name & " where ID=" & ID
		End If
		Call Exe_Conn(rsDel,sqlDel,3)
		Do While Not rsDel.EOF
			If Csid = "" Then
				Csid = rsDel("ClassID")
			Else
				Csid = Csid & "," & rsDel("ClassID")
			End If
			rsDel("IsDelete") = WK_False
			rsDel.Update
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		Response.Write "{""code"":1,""msg"":""\u6210\u529f\u8fd8\u539f\u9009\u5b9a\u7684"&ChannelTit&"\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		Response.End()
	End If
End Sub

Sub RestoreAll()
	If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
		Dim ID,rsDel,sqlDel,Csid
		ChannelID = Code_CLng(Trim(Code_Form("ChannelID")))
		If ChannelID = "" Then
			Response.Write "{""code"":0,""msg"":""\u9891\u9053ID\u4e3a\u7a7a""}"
			Response.End()
		End If
		sqlDel = "select ID,ClassID From " & Data_Name & " where IsDelete=" & WK_True & " and ChannelID=" & ChannelID
		Call Exec(rsDel,sqlDel,2)
		Do While Not rsDel.EOF
			If ID = "" Then
				ID = rsDel(0)
			Else
				ID = ID & "," & rsDel(0)
			End If
			If Csid = "" Then
				Csid = rsDel(1)
			Else
				Csid = Csid & "," & rsDel(1)
			End If
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		sqlDel = "select * From " & Data_Name & " where IsDelete=" & WK_True & " and ChannelID=" & ChannelID
		Call Exe_Conn(rsDel,sqlDel,3)
		Do While Not rsDel.EOF
			rsDel("IsDelete") = WK_False
			rsDel.Update
			rsDel.MoveNext
		Loop
		rsDel.Close
		Set rsDel = Nothing
		Response.Write "{""code"":1,""msg"":""\u6210\u529f\u8fd8\u539f\u6240\u6709"&ChannelTit&"\uff01"",""ClassID"":"""&Csid&""",""id"":"""&ID&"""}"
		Response.End()
	End If
End Sub
%>